mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
fix sorting of folders with Group direct subfolders enabled
This commit is contained in:
@@ -130,6 +130,14 @@ fun Context.getSortedDirectories(source: ArrayList<Directory>): ArrayList<Direct
|
|||||||
|
|
||||||
var result = when {
|
var result = when {
|
||||||
sorting and SORT_BY_NAME != 0 -> {
|
sorting and SORT_BY_NAME != 0 -> {
|
||||||
|
if (o1.sortValue.isEmpty()) {
|
||||||
|
o1.sortValue = o1.name.toLowerCase()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (o2.sortValue.isEmpty()) {
|
||||||
|
o2.sortValue = o2.name.toLowerCase()
|
||||||
|
}
|
||||||
|
|
||||||
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.toLowerCase(), o2.sortValue.toLowerCase())
|
||||||
} else {
|
} else {
|
||||||
@@ -137,6 +145,14 @@ fun Context.getSortedDirectories(source: ArrayList<Directory>): ArrayList<Direct
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
sorting and SORT_BY_PATH != 0 -> {
|
sorting and SORT_BY_PATH != 0 -> {
|
||||||
|
if (o1.sortValue.isEmpty()) {
|
||||||
|
o1.sortValue = o1.path.toLowerCase()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (o2.sortValue.isEmpty()) {
|
||||||
|
o2.sortValue = o2.path.toLowerCase()
|
||||||
|
}
|
||||||
|
|
||||||
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.toLowerCase(), o2.sortValue.toLowerCase())
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user