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 bd5b65f44..358fb253c 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 @@ -166,8 +166,8 @@ fun Context.getSortedDirectories(source: ArrayList): ArrayList AlphanumericComparator().compare(o1.name.toLowerCase(), o2.name.toLowerCase()) - sorting and SORT_BY_PATH != 0 -> AlphanumericComparator().compare(o1.path.toLowerCase(), o2.path.toLowerCase()) + sorting and SORT_BY_NAME != 0 -> o1.name.toLowerCase().compareTo(o2.name.toLowerCase()) + sorting and SORT_BY_PATH != 0 -> o1.path.toLowerCase().compareTo(o2.path.toLowerCase()) sorting and SORT_BY_SIZE != 0 -> o1.size.compareTo(o2.size) sorting and SORT_BY_DATE_MODIFIED != 0 -> o1.modified.compareTo(o2.modified) else -> o1.taken.compareTo(o2.taken) 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 785627944..caef3de15 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 @@ -287,8 +287,8 @@ class MediaFetcher(val context: Context) { o1 as Medium o2 as Medium var result = when { - sorting and SORT_BY_NAME != 0 -> AlphanumericComparator().compare(o1.name.toLowerCase(), o2.name.toLowerCase()) - sorting and SORT_BY_PATH != 0 -> AlphanumericComparator().compare(o1.path.toLowerCase(), o2.path.toLowerCase()) + sorting and SORT_BY_NAME != 0 -> o1.name.toLowerCase().compareTo(o2.name.toLowerCase()) + sorting and SORT_BY_PATH != 0 -> o1.path.toLowerCase().compareTo(o2.path.toLowerCase()) sorting and SORT_BY_SIZE != 0 -> o1.size.compareTo(o2.size) sorting and SORT_BY_DATE_MODIFIED != 0 -> o1.modified.compareTo(o2.modified) else -> o1.taken.compareTo(o2.taken)