Skip to content

Commit

Permalink
Add radio and checkbox logic
Browse files Browse the repository at this point in the history
  • Loading branch information
cooltey committed Oct 20, 2023
1 parent 903ad4d commit 41e9333
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 {
Expand Down

0 comments on commit 41e9333

Please sign in to comment.