From 914d97c23180a506c0c92314a9ed1f844b410075 Mon Sep 17 00:00:00 2001 From: Doozy Date: Thu, 19 May 2022 10:55:26 +0300 Subject: [PATCH] Changes for readability --- .../gallery/pro/adapters/DirectoryAdapter.kt | 5 ++++- .../simplemobiletools/gallery/pro/adapters/MediaAdapter.kt | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) 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)" }