From 79dfab5efac3e5f4a6c59915b067ed262f98ef51 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 9 Apr 2018 14:28:11 +0200 Subject: [PATCH] fix hiding folders when Show Hidden Items is disabled --- .../simplemobiletools/gallery/adapters/DirectoryAdapter.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt index 4a2dddf24..6992bc835 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -224,8 +224,9 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList() + val includedFolders = activity.config.includedFolders val newDirs = dirs.filterIndexed { index, directory -> - val removeDir = directory.path.startsWith(path, true) + val removeDir = File(directory.path).doesThisOrParentHaveNoMedia() && !includedFolders.contains(directory.path) if (removeDir) { affectedPositions.add(index) } @@ -234,7 +235,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList