From 91061b8f96455fabcfc09f6e24e338d5f23a7fba Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 5 Dec 2022 10:11:42 +0100 Subject: [PATCH] fix a glitch with grouping direct subfolders related to casing --- app/build.gradle | 2 +- .../simplemobiletools/gallery/pro/extensions/Context.kt | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 10d3f4a55..3a22aad3b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -78,7 +78,7 @@ android { } dependencies { - implementation 'com.github.SimpleMobileTools:Simple-Commons:20c2b96dab' + implementation 'com.github.SimpleMobileTools:Simple-Commons:e7b31d8305' implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0' implementation 'it.sephiroth.android.exif:library:1.0.1' implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.24' diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt index ca75e9b3b..a6cd47ceb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/extensions/Context.kt @@ -178,7 +178,8 @@ fun Context.getDirsToShow(dirs: ArrayList, allDirs: ArrayList, currentPathPre } } - if (currentPathPrefix.isNotEmpty() && path == currentPathPrefix || File(path).parent.equals(currentPathPrefix, true)) { + if (currentPathPrefix.isNotEmpty() && path.equals(currentPathPrefix, true) || File(path).parent.equals(currentPathPrefix, true)) { currentPaths.add(path) } else if (folders.any { !it.equals(path, true) && (File(path).parent.equals(it, true) || File(it).parent.equals(File(path).parent, true)) }) { // if we have folders like @@ -221,7 +222,7 @@ fun Context.getDirectParentSubfolders(dirs: ArrayList, currentPathPre // /storage/emulated/0/Pictures/Screenshots, // but /storage/emulated/0/Pictures is empty, still Pictures with the first folders thumbnails and proper other info val parent = File(path).parent - if (parent != null && !folders.contains(parent) && dirs.none { it.path == parent }) { + if (parent != null && !folders.contains(parent) && dirs.none { it.path.equals(parent, true) }) { currentPaths.add(parent) val isSortingAscending = config.sorting.isSortingAscending() val subDirs = dirs.filter { File(it.path).parent.equals(File(path).parent, true) } as ArrayList