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 -> {
|
R.id.cab_delete -> {
|
||||||
executeItemMenuOperation(recordingId) {
|
executeItemMenuOperation(recordingId, removeAfterCallback = false) {
|
||||||
deleteMediaStoreRecordings()
|
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)
|
selectedKeys.add(callId)
|
||||||
callback()
|
callback()
|
||||||
|
if (removeAfterCallback) {
|
||||||
selectedKeys.remove(callId)
|
selectedKeys.remove(callId)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user