mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2025-01-19 06:48:00 +01:00
fix hiding folders when Show Hidden Items is disabled
This commit is contained in:
parent
2b37c315f1
commit
79dfab5efa
1 changed files with 4 additions and 2 deletions
|
@ -224,8 +224,9 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
|
|||
updateFolderNames()
|
||||
} else {
|
||||
val affectedPositions = ArrayList<Int>()
|
||||
val includedFolders = activity.config.includedFolders
|
||||
val newDirs = dirs.filterIndexed { index, directory ->
|
||||
val removeDir = directory.path.startsWith(path, true)
|
||||
val removeDir = File(directory.path).doesThisOrParentHaveNoMedia() && !includedFolders.contains(directory.path)
|
||||
if (removeDir) {
|
||||
affectedPositions.add(index)
|
||||
}
|
||||
|
@ -234,7 +235,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
|
|||
|
||||
activity.runOnUiThread {
|
||||
affectedPositions.sortedDescending().forEach {
|
||||
notifyItemRemoved(it + positionOffset)
|
||||
notifyItemRemoved(it)
|
||||
itemViews.put(it, null)
|
||||
}
|
||||
|
||||
|
@ -245,6 +246,7 @@ class DirectoryAdapter(activity: BaseSimpleActivity, var dirs: ArrayList<Directo
|
|||
|
||||
currentDirectoriesHash = newDirs.hashCode()
|
||||
itemViews = newItems
|
||||
dirs = newDirs
|
||||
finishActMode()
|
||||
fastScroller?.measureRecyclerView()
|
||||
listener?.updateDirectories(newDirs, false)
|
||||
|
|
Loading…
Reference in a new issue