Merge pull request #155 from KryptKode/feat/delete-confirm-dialog
confirm recording delete from the overflow menu
This commit is contained in:
commit
74b966410a
1 changed files with 6 additions and 4 deletions
|
@ -273,8 +273,8 @@ class RecordingsAdapter(
|
|||
}
|
||||
}
|
||||
R.id.cab_delete -> {
|
||||
executeItemMenuOperation(recordingId) {
|
||||
deleteMediaStoreRecordings()
|
||||
executeItemMenuOperation(recordingId, removeAfterCallback = false) {
|
||||
askConfirmDelete()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -285,9 +285,11 @@ class RecordingsAdapter(
|
|||
}
|
||||
}
|
||||
|
||||
private fun executeItemMenuOperation(callId: Int, callback: () -> Unit) {
|
||||
private fun executeItemMenuOperation(callId: Int, removeAfterCallback: Boolean = true, callback: () -> Unit) {
|
||||
selectedKeys.add(callId)
|
||||
callback()
|
||||
if (removeAfterCallback) {
|
||||
selectedKeys.remove(callId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue