mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
fix #1427, properly handle diacritics at sorting
This commit is contained in:
@ -139,9 +139,9 @@ fun Context.getSortedDirectories(source: ArrayList<Directory>): ArrayList<Direct
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (sorting and SORT_USE_NUMERIC_VALUE != 0) {
|
if (sorting and SORT_USE_NUMERIC_VALUE != 0) {
|
||||||
AlphanumericComparator().compare(o1.sortValue.toLowerCase(), o2.sortValue.toLowerCase())
|
AlphanumericComparator().compare(o1.sortValue.normalizeString().toLowerCase(), o2.sortValue.normalizeString().toLowerCase())
|
||||||
} else {
|
} else {
|
||||||
o1.sortValue.toLowerCase().compareTo(o2.sortValue.toLowerCase())
|
o1.sortValue.normalizeString().toLowerCase().compareTo(o2.sortValue.normalizeString().toLowerCase())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sorting and SORT_BY_PATH != 0 -> {
|
sorting and SORT_BY_PATH != 0 -> {
|
||||||
|
@ -761,9 +761,9 @@ class MediaFetcher(val context: Context) {
|
|||||||
var result = when {
|
var result = when {
|
||||||
sorting and SORT_BY_NAME != 0 -> {
|
sorting and SORT_BY_NAME != 0 -> {
|
||||||
if (sorting and SORT_USE_NUMERIC_VALUE != 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 {
|
} else {
|
||||||
o1.name.toLowerCase().compareTo(o2.name.toLowerCase())
|
o1.name.normalizeString().toLowerCase().compareTo(o2.name.normalizeString().toLowerCase())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sorting and SORT_BY_PATH != 0 -> {
|
sorting and SORT_BY_PATH != 0 -> {
|
||||||
|
Reference in New Issue
Block a user