Merge pull request #296 from cyb3rko/message-delete-confirmation
Confirmation dialog to delete all messages
This commit is contained in:
@@ -521,10 +521,17 @@ internal class MessagesActivity :
|
|||||||
|
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
if (item.itemId == R.id.action_delete_all) {
|
if (item.itemId == R.id.action_delete_all) {
|
||||||
|
MaterialAlertDialogBuilder(this)
|
||||||
|
.setTitle(R.string.delete_all)
|
||||||
|
.setMessage(R.string.ack)
|
||||||
|
.setPositiveButton(R.string.yes) { _, _ ->
|
||||||
launchCoroutine {
|
launchCoroutine {
|
||||||
deleteMessages(viewModel.appId)
|
deleteMessages(viewModel.appId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.setNegativeButton(R.string.no, null)
|
||||||
|
.show()
|
||||||
|
}
|
||||||
if (item.itemId == R.id.action_delete_app) {
|
if (item.itemId == R.id.action_delete_app) {
|
||||||
MaterialAlertDialogBuilder(this)
|
MaterialAlertDialogBuilder(this)
|
||||||
.setTitle(R.string.delete_app)
|
.setTitle(R.string.delete_app)
|
||||||
|
|||||||
Reference in New Issue
Block a user