show the file name at deletion, if it is only one item

This commit is contained in:
tibbi 2021-05-19 22:53:56 +02:00
parent 1b1508282a
commit 004fc2f362

View File

@ -638,8 +638,13 @@ class ItemsAdapter(activity: SimpleActivity, var listItems: MutableList<ListItem
private fun askConfirmDelete() {
activity.handleDeletePasswordProtection {
val selectionSize = selectedKeys.size
val items = resources.getQuantityString(R.plurals.delete_items, selectionSize, selectionSize)
val itemsCnt = selectedKeys.size
val items = if (itemsCnt == 1) {
"\"${getFirstSelectedItemPath().getFilenameFromPath()}\""
} else {
resources.getQuantityString(R.plurals.delete_items, itemsCnt, itemsCnt)
}
val question = String.format(resources.getString(R.string.deletion_confirmation), items)
ConfirmationDialog(activity, question) {
deleteFiles()