diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt index a5a2dd928..319c2008d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/DirectoryAdapter.kt @@ -602,7 +602,10 @@ class DirectoryAdapter( } else { val paths = getSelectedPaths() val fileDirItems = ArrayList(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() "${resources.getQuantityString(R.plurals.delete_items, itemsCnt, itemsCnt)} ($size)" } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt index b21ab363d..7d4ca81ca 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt @@ -470,7 +470,10 @@ class MediaAdapter( } else { val paths = getSelectedPaths() val fileDirItems = ArrayList(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() "${resources.getQuantityString(R.plurals.delete_items, itemsCnt, itemsCnt)} ($size)" }