From d566295aaffefe29b2c6cdfdd34db2cc85704c30 Mon Sep 17 00:00:00 2001 From: gedoor Date: Tue, 8 Dec 2020 20:38:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=AD=E6=96=87=E6=8E=92?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/ui/book/cache/CacheActivity.kt | 4 +++- app/src/main/java/io/legado/app/utils/FileUtils.kt | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) 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) }