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 ->