From 288cf8603f0bc6a02b1315321ef5ab2dae60d83a Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 20 Sep 2019 10:22:50 +0800 Subject: [PATCH] up --- .../rss/source/edit/RssSourceEditActivity.kt | 2 +- .../ui/rss/source/manage/RssSourceActivity.kt | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt b/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt index 599e1d9f7..e58ba568c 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt @@ -11,9 +11,9 @@ class RssSourceEditActivity : override val viewModel: RssSourceEditViewModel get() = getViewModel(RssSourceEditViewModel::class.java) + override fun onActivityCreated(savedInstanceState: Bundle?) { } - } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt b/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt index 4d56fb6d7..3b729e01e 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt @@ -1,6 +1,7 @@ package io.legado.app.ui.rss.source.manage import android.os.Bundle +import androidx.appcompat.widget.SearchView import androidx.core.content.ContextCompat import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.ItemTouchHelper @@ -10,8 +11,10 @@ import io.legado.app.base.VMBaseActivity import io.legado.app.data.entities.RssSource import io.legado.app.help.ItemTouchCallback import io.legado.app.lib.theme.ATH +import io.legado.app.lib.theme.primaryTextColor import io.legado.app.utils.getViewModel import kotlinx.android.synthetic.main.activity_rss_source.* +import kotlinx.android.synthetic.main.view_search.* class RssSourceActivity : VMBaseActivity(R.layout.activity_rss_source), @@ -24,6 +27,7 @@ class RssSourceActivity : VMBaseActivity(R.layout.activity_r override fun onActivityCreated(savedInstanceState: Bundle?) { initRecyclerView() + initSearchView() } private fun initRecyclerView() { @@ -43,6 +47,23 @@ class RssSourceActivity : VMBaseActivity(R.layout.activity_r ItemTouchHelper(itemTouchCallback).attachToRecyclerView(recycler_view) } + private fun initSearchView() { + ATH.setTint(search_view, primaryTextColor) + search_view.onActionViewExpanded() + search_view.queryHint = getString(R.string.search_book_source) + search_view.clearFocus() + search_view.setOnQueryTextListener(object : SearchView.OnQueryTextListener { + override fun onQueryTextSubmit(query: String?): Boolean { + return false + } + + override fun onQueryTextChange(newText: String?): Boolean { + return false + } + + }) + } + override fun del(source: RssSource) { }