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