mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-30 00:17:58 +01:00
show .nomedia folders if Show hidden folders is checked
This commit is contained in:
parent
ccf71496e2
commit
df5981f74c
1 changed files with 12 additions and 9 deletions
|
@ -143,16 +143,19 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va
|
|||
}
|
||||
|
||||
private fun removeNoMediaFolders(dirs: MutableList<Directory>) {
|
||||
val ignoreDirs = ArrayList<Directory>()
|
||||
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<Directory>()
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue