From 548fa8993f9063afe5c57652de5f68042b1791ae Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Mon, 6 Dec 2021 22:06:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=90=9C=E7=B4=A2=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xyz/fycz/myreader/ui/activity/SearchWordActivity.kt | 7 +++++++ .../fycz/myreader/ui/adapter/holder/SearchWord1Holder.kt | 3 ++- app/src/main/res/layout/activity_search_word.xml | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/xyz/fycz/myreader/ui/activity/SearchWordActivity.kt b/app/src/main/java/xyz/fycz/myreader/ui/activity/SearchWordActivity.kt index c7a41d0..7fb65b5 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/activity/SearchWordActivity.kt +++ b/app/src/main/java/xyz/fycz/myreader/ui/activity/SearchWordActivity.kt @@ -96,6 +96,12 @@ class SearchWordActivity : BaseActivity() { override fun loadFinish(isEmpty: Boolean) { binding.fabSearchStop.visibility = View.GONE binding.rpb.isAutoLoading = false + var sum = 0 + adapter.items.forEach { + sum += it.searchWord2List.size + } + supportActionBar?.title = getString(R.string.search_word) + "(共" + adapter.itemSize + + "个章节," + sum + "条结果)" } @Synchronized @@ -139,6 +145,7 @@ class SearchWordActivity : BaseActivity() { private fun search() { val keyword = binding.etSearchKey.text.toString() if (keyword.isNotEmpty()) { + supportActionBar?.title = getString(R.string.search_word) adapter.clear() binding.fabSearchStop.visibility = View.VISIBLE binding.rpb.isAutoLoading = true diff --git a/app/src/main/java/xyz/fycz/myreader/ui/adapter/holder/SearchWord1Holder.kt b/app/src/main/java/xyz/fycz/myreader/ui/adapter/holder/SearchWord1Holder.kt index 63cc301..ea48854 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/adapter/holder/SearchWord1Holder.kt +++ b/app/src/main/java/xyz/fycz/myreader/ui/adapter/holder/SearchWord1Holder.kt @@ -1,5 +1,6 @@ package xyz.fycz.myreader.ui.adapter.holder +import android.annotation.SuppressLint import android.app.Activity import android.content.Intent import android.view.View @@ -34,7 +35,7 @@ class SearchWord1Holder(var activity: AppCompatActivity) : ViewHolderImpl() { override fun createViewHolder(viewType: Int): IViewHolder { return SearchWord2Holder() diff --git a/app/src/main/res/layout/activity_search_word.xml b/app/src/main/res/layout/activity_search_word.xml index ab3740c..06d9c19 100644 --- a/app/src/main/res/layout/activity_search_word.xml +++ b/app/src/main/res/layout/activity_search_word.xml @@ -55,7 +55,7 @@