diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt index dddbcabab..1019786b3 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetDirectoriesAsynctask.kt @@ -143,16 +143,19 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va } private fun removeNoMediaFolders(dirs: MutableList) { - val ignoreDirs = ArrayList() - for (d in dirs) { - val dir = File(d.path) - if (dir.exists() && dir.isDirectory) { - val res = dir.list { file, filename -> filename == ".nomedia" } - if (res?.isNotEmpty() == true) - ignoreDirs.add(d) + val showHiddenFolders = mConfig.showHiddenFolders + if (!showHiddenFolders) { + val ignoreDirs = ArrayList() + for (d in dirs) { + val dir = File(d.path) + if (dir.exists() && dir.isDirectory) { + val res = dir.list { file, filename -> filename == ".nomedia" } + if (res?.isNotEmpty() == true) + ignoreDirs.add(d) + } } - } - dirs.removeAll(ignoreDirs) + dirs.removeAll(ignoreDirs) + } } }