mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-22 20:48:00 +01:00
hide folders starting with a dot if hidden should be shown
This commit is contained in:
parent
959b0862f5
commit
e243de95d1
1 changed files with 7 additions and 2 deletions
|
@ -73,17 +73,22 @@ fun Context.getParents(): ArrayList<String> {
|
|||
if (config.showHiddenFolders) {
|
||||
parents.addAll(getNoMediaFolders())
|
||||
} else {
|
||||
removeNoMediaFolders(parents)
|
||||
removeHiddenFolders(parents)
|
||||
}
|
||||
|
||||
return parents
|
||||
}
|
||||
|
||||
private fun removeNoMediaFolders(paths: MutableList<String>) {
|
||||
private fun removeHiddenFolders(paths: MutableList<String>) {
|
||||
val ignorePaths = ArrayList<String>()
|
||||
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)
|
||||
|
|
Loading…
Reference in a new issue