diff --git a/app/src/main/java/io/legado/app/ui/book/cache/CacheActivity.kt b/app/src/main/java/io/legado/app/ui/book/cache/CacheActivity.kt index fa6f6220f..74f4164fe 100644 --- a/app/src/main/java/io/legado/app/ui/book/cache/CacheActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/cache/CacheActivity.kt @@ -129,7 +129,9 @@ class CacheActivity : VMBaseActivity() } val books = when (getPrefInt(PreferKey.bookshelfSort)) { 1 -> booksDownload.sortedByDescending { it.latestChapterTime } - 2 -> booksDownload.sortedBy { it.name } + 2 -> booksDownload.sortedWith { o1, o2 -> + o1.name.cnCompare(o2.name) + } 3 -> booksDownload.sortedBy { it.order } else -> booksDownload.sortedByDescending { it.durChapterTime } } diff --git a/app/src/main/java/io/legado/app/utils/FileUtils.kt b/app/src/main/java/io/legado/app/utils/FileUtils.kt index ac7adaaa9..c42f6f7d4 100644 --- a/app/src/main/java/io/legado/app/utils/FileUtils.kt +++ b/app/src/main/java/io/legado/app/utils/FileUtils.kt @@ -710,7 +710,7 @@ object FileUtils { val s1 = f1.name val s2 = f2.name if (caseSensitive) { - s1.compareTo(s2) + s1.cnCompare(s2) } else { s1.compareTo(s2, ignoreCase = true) }