From 619e7ee3f4727f0cd356ce5c01703f01f57a0757 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 15 Dec 2018 22:40:15 +0100 Subject: [PATCH] show the current folder as an available option at grouping too, not just subfolders --- .../gallery/pro/activities/MainActivity.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt index 11207297f..326f9954d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt @@ -975,6 +975,16 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { val foldersToShow = getDirectParentSubfolders(dirFolders) val parentDirs = dirs.filter { foldersToShow.contains(it.path) } as ArrayList 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 }