From 7ffd6b457ef41576082f3b9146dbb2857fd98f57 Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 24 Mar 2021 12:28:23 +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 --- app/src/main/java/io/legado/app/ui/main/MainActivity.kt | 2 -- .../java/io/legado/app/ui/main/explore/ExploreFragment.kt | 5 +++++ app/src/main/java/io/legado/app/ui/main/rss/RssFragment.kt | 5 +++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt index 1edd9c2bb..5a45149a3 100644 --- a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt +++ b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt @@ -30,7 +30,6 @@ import io.legado.app.ui.main.explore.ExploreFragment import io.legado.app.ui.main.my.MyFragment import io.legado.app.ui.main.rss.RssFragment import io.legado.app.ui.widget.dialog.TextDialog -import io.legado.app.utils.hideSoftInput import io.legado.app.utils.observeEvent import io.legado.app.utils.toastOnUi @@ -122,7 +121,6 @@ class MainActivity : VMBaseActivity(), } override fun onPageSelected(position: Int) = with(binding) { - viewPagerMain.hideSoftInput() pagePosition = position when (position) { 0, 1, 3 -> bottomNavigationView.menu.getItem(position).isChecked = true diff --git a/app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt b/app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt index 92e5404da..b9f098ccb 100644 --- a/app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt @@ -59,6 +59,11 @@ class ExploreFragment : VMBaseFragment(R.layout.fragment_explo upGroupsMenu() } + override fun onPause() { + super.onPause() + searchView.clearFocus() + } + private fun initSearchView() { ATH.setTint(searchView, primaryTextColor) searchView.onActionViewExpanded() diff --git a/app/src/main/java/io/legado/app/ui/main/rss/RssFragment.kt b/app/src/main/java/io/legado/app/ui/main/rss/RssFragment.kt index 6441cea91..c8da52722 100644 --- a/app/src/main/java/io/legado/app/ui/main/rss/RssFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/rss/RssFragment.kt @@ -72,6 +72,11 @@ class RssFragment : VMBaseFragment(R.layout.fragment_rss), } } + override fun onPause() { + super.onPause() + searchView.clearFocus() + } + private fun upGroupsMenu() = groupsMenu?.let { subMenu -> subMenu.removeGroup(R.id.menu_group_text) groups.sortedWith { o1, o2 ->