diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt index 299d0c90c..ccdad77d3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/context.kt @@ -73,17 +73,22 @@ fun Context.getParents(): ArrayList { if (config.showHiddenFolders) { parents.addAll(getNoMediaFolders()) } else { - removeNoMediaFolders(parents) + removeHiddenFolders(parents) } return parents } -private fun removeNoMediaFolders(paths: MutableList) { +private fun removeHiddenFolders(paths: MutableList) { val ignorePaths = ArrayList() for (path in paths) { val dir = File(path) if (dir.exists() && dir.isDirectory) { + if (dir.name.startsWith(".")) { + ignorePaths.add((path)) + continue + } + val res = dir.list { file, filename -> filename == NOMEDIA } if (res?.isNotEmpty() == true) ignorePaths.add(path)