fix(dialog): On Android, do not add a Cancel button to message dialogs (#873)

This commit is contained in:
Olivier Lemasle
2024-01-11 03:30:32 +01:00
committed by GitHub
parent 1b1d795b58
commit bf5a21d5b2
3 changed files with 28 additions and 7 deletions
@@ -190,16 +190,16 @@ class DialogPlugin(private val activity: Activity): Plugin(activity) {
dialog.dismiss()
handler(false, true)
}
.setNegativeButton(
args.cancelButtonLabel ?: "Cancel"
) { dialog, _ ->
dialog.dismiss()
handler(false, false)
}
.setOnCancelListener { dialog ->
dialog.dismiss()
handler(true, false)
}
if (args.cancelButtonLabel != null) {
builder.setNegativeButton( args.cancelButtonLabel) { dialog, _ ->
dialog.dismiss()
handler(false, false)
}
}
val dialog = builder.create()
dialog.show()
}