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 0f3e364a4..c2631fc93 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 @@ -170,6 +170,10 @@ fun Context.getSortedDirectories(source: ArrayList): ArrayList o1.taken.compareTo(o2.taken) } + if (result == 0) { + result = AlphanumericComparator().compare(o1.path.toLowerCase(), o2.path.toLowerCase()) + } + if (sorting and SORT_DESCENDING != 0) { result *= -1 } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt index 24d571dfa..b57e37c70 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt @@ -364,6 +364,10 @@ class MediaFetcher(val context: Context) { else -> o1.taken.compareTo(o2.taken) } + if (result == 0) { + result = AlphanumericComparator().compare(o1.path.toLowerCase(), o2.path.toLowerCase()) + } + if (sorting and SORT_DESCENDING != 0) { result *= -1 }