mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-01-30 11:14:48 +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
@ -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…
x
Reference in New Issue
Block a user