diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt index e545ff080..271f065ed 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Directory.kt @@ -41,9 +41,10 @@ data class Directory(val path: String, val tmb: String, val name: String, var me } fun getBubbleText() = when { + sorting and SORT_BY_NAME != 0 -> name + sorting and SORT_BY_PATH != 0 -> path sorting and SORT_BY_SIZE != 0 -> size.formatSize() sorting and SORT_BY_DATE_MODIFIED != 0 -> modified.formatDate() - sorting and SORT_BY_DATE_TAKEN != 0 -> taken.formatDate() - else -> name + else -> taken.formatDate() } } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt index 6572cfacb..1d113e4aa 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/models/Medium.kt @@ -26,6 +26,7 @@ data class Medium(var name: String, var path: String, val video: Boolean, val mo var result: Int when { sorting and SORT_BY_NAME != 0 -> result = AlphanumericComparator().compare(name.toLowerCase(), other.name.toLowerCase()) + sorting and SORT_BY_PATH != 0 -> result = AlphanumericComparator().compare(path.toLowerCase(), other.path.toLowerCase()) sorting and SORT_BY_SIZE != 0 -> result = when { size == other.size -> 0 size > other.size -> 1 @@ -50,9 +51,10 @@ data class Medium(var name: String, var path: String, val video: Boolean, val mo } fun getBubbleText() = when { + sorting and SORT_BY_NAME != 0 -> name + sorting and SORT_BY_PATH != 0 -> path sorting and SORT_BY_SIZE != 0 -> size.formatSize() sorting and SORT_BY_DATE_MODIFIED != 0 -> modified.formatDate() - sorting and SORT_BY_DATE_TAKEN != 0 -> taken.formatDate() - else -> name + else -> taken.formatDate() } }