Skip to content

Commit

Permalink
Add getter for Checkbox prompt used in AlertDialogFacade
Browse files Browse the repository at this point in the history
Replicates the MaterialDialog.getCheckboxPrompt() extension and it would
be useful for migrating some dialogs.
  • Loading branch information
lukstbit committed Feb 7, 2024
1 parent bcc4df0 commit 219bf2e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions AnkiDroid/src/main/java/com/ichi2/utils/AlertDialogFacade.kt
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ fun AlertDialog.Builder.checkBoxPrompt(
return this.setView(checkBoxView)
}

fun AlertDialog.getCheckBoxPrompt(): CheckBox =
requireNotNull(findViewById(R.id.checkbox)) {
"CheckBox prompt is not available. Forgot to call AlertDialog.Builder.checkBoxPrompt()?"
}

fun AlertDialog.Builder.customView(
view: View,
paddingTop: Int = 0,
Expand Down

0 comments on commit 219bf2e

Please sign in to comment.