From 5727d11946b0ac177a7feee63966d109aecd3eee Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 27 Feb 2020 15:52:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= 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 f56ad21d6..47671626d 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 @@ -85,8 +85,8 @@ class SearchViewModel(application: Application) : BaseViewModel(application) { private fun precisionSearch(searchBooks: List) { val books = arrayListOf() searchBooks.forEach { searchBook -> - if (searchBook.name.equals(searchKey, true) - || searchBook.author.equals(searchKey, true) + if (searchBook.name.contains(searchKey, true) + || searchBook.author.contains(searchKey, true) ) books.add(searchBook) } App.db.searchBookDao().insert(*books.toTypedArray())