mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
show the current folder as an available option at grouping too, not just subfolders
This commit is contained in:
parent
ce4dee2573
commit
619e7ee3f4
1 changed files with 10 additions and 0 deletions
|
@ -975,6 +975,16 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
|
|||
val foldersToShow = getDirectParentSubfolders(dirFolders)
|
||||
val parentDirs = dirs.filter { foldersToShow.contains(it.path) } as ArrayList<Directory>
|
||||
updateSubfolderCounts(dirs, parentDirs)
|
||||
|
||||
// show the current folder as an available option too, not just subfolders
|
||||
if (mCurrentPathPrefix.isNotEmpty()) {
|
||||
val currentFolder = mDirs.firstOrNull { parentDirs.firstOrNull { it.path == mCurrentPathPrefix } == null && it.path == mCurrentPathPrefix }
|
||||
currentFolder?.apply {
|
||||
subfoldersCount = 1
|
||||
parentDirs.add(this)
|
||||
}
|
||||
}
|
||||
|
||||
parentDirs
|
||||
} else {
|
||||
dirs.forEach { it.subfoldersMediaCount = it.mediaCnt }
|
||||
|
|
Loading…
Reference in a new issue