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 -> {
|
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()
|
||||||
selectedKeys.remove(callId)
|
if (removeAfterCallback) {
|
||||||
|
selectedKeys.remove(callId)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue