0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-19 19:42:17 +02:00

Add getter for Checkbox prompt used in AlertDialogFacade

Replicates the MaterialDialog.getCheckboxPrompt() extension and it would
be useful for migrating some dialogs.
This commit is contained in:
lukstbit 2024-02-06 19:00:00 +02:00 committed by David Allison
parent b7bdcb1434
commit d0c380564a

View File

@ -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,