From c08739396a7a5e21c2a387063cae3f68549d8298 Mon Sep 17 00:00:00 2001 From: Administrator Date: Fri, 20 Dec 2019 21:35:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dsearch=5Fview=E8=8E=B7?= =?UTF-8?q?=E5=BE=97=E7=84=A6=E7=82=B9=E6=97=B6=E4=B8=8D=E8=83=BD=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=E6=A3=80=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/ui/book/search/SearchActivity.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt b/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt index 0ffefda51..d6eb7f836 100644 --- a/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt @@ -49,6 +49,7 @@ class SearchActivity : VMBaseActivity(R.layout.activity_book_se private var menu: Menu? = null private var precisionSearchMenuItem: MenuItem? = null private var groups = hashSetOf() + private var queryText: String? = null override fun onActivityCreated(savedInstanceState: Bundle?) { viewModel.callBack = this @@ -107,8 +108,9 @@ class SearchActivity : VMBaseActivity(R.layout.activity_book_se } override fun onQueryTextChange(newText: String?): Boolean { - if (newText.isNullOrBlank()) viewModel.stop() - upHistory(newText) + queryText = newText + if (queryText.isNullOrBlank()) viewModel.stop() + upHistory(queryText) return false } }) @@ -180,7 +182,7 @@ class SearchActivity : VMBaseActivity(R.layout.activity_book_se private fun openOrCloseHistory(open: Boolean) { if (open) { - upHistory("") + upHistory(queryText) ll_history.visibility = VISIBLE } else { ll_history.visibility = GONE