allow adding a dialog title at the confirmation dialog

This commit is contained in:
tibbi 2023-01-11 22:31:36 +01:00
parent 8f464e1934
commit b61b4f3f05

View file

@ -19,7 +19,7 @@ import kotlinx.android.synthetic.main.dialog_message.view.*
*/
class ConfirmationDialog(
activity: Activity, message: String = "", messageId: Int = R.string.proceed_with_deletion, positive: Int = R.string.yes,
negative: Int = R.string.no, val cancelOnTouchOutside: Boolean = true, val callback: () -> Unit
negative: Int = R.string.no, val cancelOnTouchOutside: Boolean = true, dialogTitle: String = "", val callback: () -> Unit
) {
private var dialog: AlertDialog? = null
@ -35,7 +35,7 @@ class ConfirmationDialog(
}
builder.apply {
activity.setupDialogStuff(view, this, cancelOnTouchOutside = cancelOnTouchOutside) { alertDialog ->
activity.setupDialogStuff(view, this, titleText = dialogTitle, cancelOnTouchOutside = cancelOnTouchOutside) { alertDialog ->
dialog = alertDialog
}
}