mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-23 04:57:59 +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) {
|
if (config.showHiddenFolders) {
|
||||||
parents.addAll(getNoMediaFolders())
|
parents.addAll(getNoMediaFolders())
|
||||||
} else {
|
} else {
|
||||||
removeNoMediaFolders(parents)
|
removeHiddenFolders(parents)
|
||||||
}
|
}
|
||||||
|
|
||||||
return parents
|
return parents
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun removeNoMediaFolders(paths: MutableList<String>) {
|
private fun removeHiddenFolders(paths: MutableList<String>) {
|
||||||
val ignorePaths = ArrayList<String>()
|
val ignorePaths = ArrayList<String>()
|
||||||
for (path in paths) {
|
for (path in paths) {
|
||||||
val dir = File(path)
|
val dir = File(path)
|
||||||
if (dir.exists() && dir.isDirectory) {
|
if (dir.exists() && dir.isDirectory) {
|
||||||
|
if (dir.name.startsWith(".")) {
|
||||||
|
ignorePaths.add((path))
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
val res = dir.list { file, filename -> filename == NOMEDIA }
|
val res = dir.list { file, filename -> filename == NOMEDIA }
|
||||||
if (res?.isNotEmpty() == true)
|
if (res?.isNotEmpty() == true)
|
||||||
ignorePaths.add(path)
|
ignorePaths.add(path)
|
||||||
|
|
Loading…
Reference in a new issue