From 33c8ddb86c90cf23e83e7c1bc80e08555604d58f Mon Sep 17 00:00:00 2001 From: gedoor Date: Mon, 19 Oct 2020 08:27:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/ui/book/search/SearchViewModel.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/search/SearchViewModel.kt b/app/src/main/java/io/legado/app/ui/book/search/SearchViewModel.kt index 179b2cd9b..7d5b1858a 100644 --- a/app/src/main/java/io/legado/app/ui/book/search/SearchViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/search/SearchViewModel.kt @@ -144,7 +144,7 @@ class SearchViewModel(application: Application) : BaseViewModel(application), } } if (!scope.isActive) return - searchBooks.sortWith(Comparator { o1, o2 -> + searchBooks.sortWith { o1, o2 -> if (o1.name == searchKey && o2.name != searchKey) { 1 } else if (o1.name != searchKey && o2.name == searchKey) { @@ -168,7 +168,7 @@ class SearchViewModel(application: Application) : BaseViewModel(application), } else { 0 } - }) + } if (!scope.isActive) return searchBooks = copyDataS upAdapter()