mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
sort media/directories by path, if the original sorting result is equal
This commit is contained in:
@ -170,6 +170,10 @@ fun Context.getSortedDirectories(source: ArrayList<Directory>): ArrayList<Direct
|
|||||||
else -> o1.taken.compareTo(o2.taken)
|
else -> o1.taken.compareTo(o2.taken)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (result == 0) {
|
||||||
|
result = AlphanumericComparator().compare(o1.path.toLowerCase(), o2.path.toLowerCase())
|
||||||
|
}
|
||||||
|
|
||||||
if (sorting and SORT_DESCENDING != 0) {
|
if (sorting and SORT_DESCENDING != 0) {
|
||||||
result *= -1
|
result *= -1
|
||||||
}
|
}
|
||||||
|
@ -364,6 +364,10 @@ class MediaFetcher(val context: Context) {
|
|||||||
else -> o1.taken.compareTo(o2.taken)
|
else -> o1.taken.compareTo(o2.taken)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (result == 0) {
|
||||||
|
result = AlphanumericComparator().compare(o1.path.toLowerCase(), o2.path.toLowerCase())
|
||||||
|
}
|
||||||
|
|
||||||
if (sorting and SORT_DESCENDING != 0) {
|
if (sorting and SORT_DESCENDING != 0) {
|
||||||
result *= -1
|
result *= -1
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user