From e765332e3b5f76be201f08be9feab6fd030386bc Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 18 Apr 2020 12:27:39 +0200 Subject: [PATCH] making the visibility toggling function a bit clearer to read --- .../gallery/pro/adapters/DirectoryAdapter.kt | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 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 3ae6643b1..224c6556c 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 @@ -235,21 +235,20 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList - if (success) { - if (path.containsNoMedia()) { - activity.removeNoMedia(path) { - if (activity.config.shouldShowHidden) { - updateFolderNames() - } else { - activity.runOnUiThread { - listener?.refreshItems() - finishActMode() + } else { + selectedPaths.filter { it != FAVORITES && it != RECYCLE_BIN && (selectedPaths.size == 1 || !activity.config.isFolderProtected(it)) }.forEach { + val path = it + activity.handleLockedFolderOpening(path) { success -> + if (success) { + if (path.containsNoMedia()) { + activity.removeNoMedia(path) { + if (activity.config.shouldShowHidden) { + updateFolderNames() + } else { + activity.runOnUiThread { + listener?.refreshItems() + finishActMode() + } } } }