Skip to content

Commit

Permalink
show the file name at deletion, if it is only one item
Browse files Browse the repository at this point in the history
  • Loading branch information
tibbi committed May 19, 2021
1 parent 1b15082 commit 004fc2f
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 004fc2f

Please sign in to comment.