confirm recording delete from the overflow menu

This commit is contained in:
darthpaul
2022-10-23 00:22:31 +01:00
parent 36e479544d
commit 26125f02df

View File

@ -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()
selectedKeys.remove(callId)
if (removeAfterCallback) {
selectedKeys.remove(callId)
}
}
}