mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-30 00:17:58 +01:00
[Removed] showing item size for folder deletion
This commit is contained in:
parent
33c1ddd761
commit
1349d4c6e0
1 changed files with 5 additions and 17 deletions
|
@ -592,23 +592,11 @@ class DirectoryAdapter(
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
val items = if (itemsCnt == 1) {
|
||||||
val itemsAndSize = if (itemsCnt == 1) {
|
val folder = getSelectedPaths().first().getFilenameFromPath()
|
||||||
val path = getSelectedPaths().first()
|
"\"$folder\""
|
||||||
val fileDirItem = File(path).toFileDirItem(activity)
|
|
||||||
val size = fileDirItem.getProperSize(activity, countHidden = true).formatSize()
|
|
||||||
val folder = path.getFilenameFromPath()
|
|
||||||
"\"$folder\" ($size)"
|
|
||||||
} else {
|
} else {
|
||||||
val paths = getSelectedPaths()
|
resources.getQuantityString(R.plurals.delete_items, itemsCnt, itemsCnt)
|
||||||
val fileDirItems = ArrayList<FileDirItem>(paths.size)
|
|
||||||
paths.forEach {
|
|
||||||
val fileDirItem = File(it).toFileDirItem(activity)
|
|
||||||
fileDirItems.add(fileDirItem)
|
|
||||||
}
|
|
||||||
val size = fileDirItems.sumByLong { it.getProperSize(activity, countHidden = true) }.formatSize()
|
|
||||||
val deleteItemsString = resources.getQuantityString(R.plurals.delete_items, itemsCnt, itemsCnt)
|
|
||||||
"$deleteItemsString ($size)"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val fileDirItem = getFirstSelectedItem() ?: return
|
val fileDirItem = getFirstSelectedItem() ?: return
|
||||||
|
@ -618,7 +606,7 @@ class DirectoryAdapter(
|
||||||
R.string.move_to_recycle_bin_confirmation
|
R.string.move_to_recycle_bin_confirmation
|
||||||
}
|
}
|
||||||
|
|
||||||
val question = String.format(resources.getString(baseString), itemsAndSize)
|
val question = String.format(resources.getString(baseString), items)
|
||||||
val warning = resources.getQuantityString(R.plurals.delete_warning, itemsCnt, itemsCnt)
|
val warning = resources.getQuantityString(R.plurals.delete_warning, itemsCnt, itemsCnt)
|
||||||
ConfirmDeleteFolderDialog(activity, question, warning) {
|
ConfirmDeleteFolderDialog(activity, question, warning) {
|
||||||
deleteFolders()
|
deleteFolders()
|
||||||
|
|
Loading…
Reference in a new issue