From 581dd43bd6a4ea41bf4ab1799757d37d75359fa4 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 13 Feb 2022 17:57:30 +0100 Subject: [PATCH] fix #1427, properly handle diacritics at sorting --- .../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 8ade06fee..2e3914fe8 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 @@ -139,9 +139,9 @@ fun Context.getSortedDirectories(source: ArrayList): ArrayList { 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 5202cb767..f27dc0005 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 @@ -761,9 +761,9 @@ class MediaFetcher(val context: Context) { var result = when { sorting and SORT_BY_NAME != 0 -> { if (sorting and SORT_USE_NUMERIC_VALUE != 0) { - AlphanumericComparator().compare(o1.name.toLowerCase(), o2.name.toLowerCase()) + AlphanumericComparator().compare(o1.name.normalizeString().toLowerCase(), o2.name.normalizeString().toLowerCase()) } else { - o1.name.toLowerCase().compareTo(o2.name.toLowerCase()) + o1.name.normalizeString().toLowerCase().compareTo(o2.name.normalizeString().toLowerCase()) } } sorting and SORT_BY_PATH != 0 -> {