mirror of
https://github.com/SimpleMobileTools/Simple-Voice-Recorder.git
synced 2025-06-05 21:59:31 +02:00
confirm recording delete from the overflow menu
This commit is contained in:
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user