mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-22 20:48:00 +01:00
small get directories style tweak
This commit is contained in:
parent
0efdb071cc
commit
926a45c72e
1 changed files with 12 additions and 15 deletions
|
@ -130,10 +130,10 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va
|
|||
}
|
||||
|
||||
private fun filterDirectories(dirs: MutableList<Directory>) {
|
||||
if (!mConfig.showHiddenFolders)
|
||||
if (!mConfig.showHiddenFolders) {
|
||||
removeHiddenFolders(dirs)
|
||||
|
||||
removeNoMediaFolders(dirs)
|
||||
removeNoMediaFolders(dirs)
|
||||
}
|
||||
}
|
||||
|
||||
private fun removeHiddenFolders(dirs: MutableList<Directory>) {
|
||||
|
@ -143,19 +143,16 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va
|
|||
}
|
||||
|
||||
private fun removeNoMediaFolders(dirs: MutableList<Directory>) {
|
||||
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)
|
||||
}
|
||||
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