mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-02-01 12:06:43 +01:00
hide the subfolders of excluded folders too
This commit is contained in:
parent
5064ca612f
commit
99376a3bb0
@ -106,10 +106,12 @@ class GetDirectoriesAsynctask(val context: Context, val isPickVideo: Boolean, va
|
||||
|
||||
private fun removeExcludedFolders(paths: MutableList<String>) {
|
||||
val excludedPaths = config.excludedFolders
|
||||
val ignorePaths = paths.filter { excludedPaths.contains(it) }
|
||||
val ignorePaths = paths.filter { isThisOrParentExcluded(it, excludedPaths) }
|
||||
paths.removeAll(ignorePaths)
|
||||
}
|
||||
|
||||
private fun isThisOrParentExcluded(path: String, excludedPaths: MutableSet<String>) = excludedPaths.any { path.startsWith(it) }
|
||||
|
||||
private fun movePinnedToFront(dirs: ArrayList<Directory>): ArrayList<Directory> {
|
||||
val foundFolders = ArrayList<Directory>()
|
||||
val pinnedFolders = config.pinnedFolders
|
||||
|
Loading…
x
Reference in New Issue
Block a user