From 2a535b5b70ac2f67f314366efaa3ce322a36ca70 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 9 Apr 2019 12:58:10 +0200 Subject: [PATCH] reverting to the previous way of sorting by string --- .../com/simplemobiletools/gallery/pro/extensions/Context.kt | 4 ++-- .../com/simplemobiletools/gallery/pro/helpers/MediaFetcher.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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 358fb253c..bd5b65f44 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 o1.name.toLowerCase().compareTo(o2.name.toLowerCase()) - sorting and SORT_BY_PATH != 0 -> o1.path.toLowerCase().compareTo(o2.path.toLowerCase()) + 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_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 caef3de15..785627944 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 -> o1.name.toLowerCase().compareTo(o2.name.toLowerCase()) - sorting and SORT_BY_PATH != 0 -> o1.path.toLowerCase().compareTo(o2.path.toLowerCase()) + 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_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)