mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-23 04:57:59 +01:00
Changes for readability
This commit is contained in:
parent
fb17549173
commit
914d97c231
2 changed files with 8 additions and 2 deletions
|
@ -602,7 +602,10 @@ class DirectoryAdapter(
|
||||||
} else {
|
} else {
|
||||||
val paths = getSelectedPaths()
|
val paths = getSelectedPaths()
|
||||||
val fileDirItems = ArrayList<FileDirItem>(paths.size)
|
val fileDirItems = ArrayList<FileDirItem>(paths.size)
|
||||||
paths.forEach { fileDirItems.add(File(it).toFileDirItem(activity)) }
|
paths.forEach {
|
||||||
|
val fileDirItem = FileDirItem(it, it.getFilenameFromPath(), activity.getIsPathDirectory(it))
|
||||||
|
fileDirItems.add(fileDirItem)
|
||||||
|
}
|
||||||
val size = fileDirItems.sumByLong { it.getProperSize(activity, countHidden = true) }.formatSize()
|
val size = fileDirItems.sumByLong { it.getProperSize(activity, countHidden = true) }.formatSize()
|
||||||
"${resources.getQuantityString(R.plurals.delete_items, itemsCnt, itemsCnt)} ($size)"
|
"${resources.getQuantityString(R.plurals.delete_items, itemsCnt, itemsCnt)} ($size)"
|
||||||
}
|
}
|
||||||
|
|
|
@ -470,7 +470,10 @@ class MediaAdapter(
|
||||||
} else {
|
} else {
|
||||||
val paths = getSelectedPaths()
|
val paths = getSelectedPaths()
|
||||||
val fileDirItems = ArrayList<FileDirItem>(paths.size)
|
val fileDirItems = ArrayList<FileDirItem>(paths.size)
|
||||||
paths.forEach { fileDirItems.add(File(it).toFileDirItem(activity)) }
|
paths.forEach {
|
||||||
|
val fileDirItem = FileDirItem(it, it.getFilenameFromPath(), activity.getIsPathDirectory(it))
|
||||||
|
fileDirItems.add(fileDirItem)
|
||||||
|
}
|
||||||
val size = fileDirItems.sumByLong { it.getProperSize(activity, countHidden = true) }.formatSize()
|
val size = fileDirItems.sumByLong { it.getProperSize(activity, countHidden = true) }.formatSize()
|
||||||
"${resources.getQuantityString(R.plurals.delete_items, itemsCnt, itemsCnt)} ($size)"
|
"${resources.getQuantityString(R.plurals.delete_items, itemsCnt, itemsCnt)} ($size)"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue