diff --git a/app/src/main/java/org/wikipedia/talk/template/TalkTemplatesTextInputDialog.kt b/app/src/main/java/org/wikipedia/talk/template/TalkTemplatesTextInputDialog.kt index ca9d7f8d682..b125fc5fcd0 100644 --- a/app/src/main/java/org/wikipedia/talk/template/TalkTemplatesTextInputDialog.kt +++ b/app/src/main/java/org/wikipedia/talk/template/TalkTemplatesTextInputDialog.kt @@ -26,6 +26,7 @@ class TalkTemplatesTextInputDialog constructor(context: Context, private var dialog: AlertDialog? = null var callback: Callback? = null val isSaveAsNewChecked get() = binding.dialogSaveAsNewCheckbox.isChecked + val isSaveExistingChecked get() = binding.dialogSaveExistingRadio.isChecked init { setView(binding.root) @@ -43,6 +44,14 @@ class TalkTemplatesTextInputDialog constructor(context: Context, setOnDismissListener { callback?.onDismiss() } + binding.dialogSaveAsNewRadio.setOnCheckedChangeListener { _, isChecked -> + binding.titleInput.isEnabled = isChecked + binding.dialogSaveExistingRadio.isChecked = !isChecked + } + binding.dialogSaveExistingRadio.setOnCheckedChangeListener { _, isChecked -> + binding.titleInput.isEnabled = !isChecked + binding.dialogSaveAsNewRadio.isChecked = !isChecked + } } override fun create(): AlertDialog {