pull/909/head
gedoor 4 years ago
parent 278ca24037
commit 7ffd6b457e
  1. 2
      app/src/main/java/io/legado/app/ui/main/MainActivity.kt
  2. 5
      app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt
  3. 5
      app/src/main/java/io/legado/app/ui/main/rss/RssFragment.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.my.MyFragment
import io.legado.app.ui.main.rss.RssFragment import io.legado.app.ui.main.rss.RssFragment
import io.legado.app.ui.widget.dialog.TextDialog 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.observeEvent
import io.legado.app.utils.toastOnUi import io.legado.app.utils.toastOnUi
@ -122,7 +121,6 @@ class MainActivity : VMBaseActivity<ActivityMainBinding, MainViewModel>(),
} }
override fun onPageSelected(position: Int) = with(binding) { override fun onPageSelected(position: Int) = with(binding) {
viewPagerMain.hideSoftInput()
pagePosition = position pagePosition = position
when (position) { when (position) {
0, 1, 3 -> bottomNavigationView.menu.getItem(position).isChecked = true 0, 1, 3 -> bottomNavigationView.menu.getItem(position).isChecked = true

@ -59,6 +59,11 @@ class ExploreFragment : VMBaseFragment<ExploreViewModel>(R.layout.fragment_explo
upGroupsMenu() upGroupsMenu()
} }
override fun onPause() {
super.onPause()
searchView.clearFocus()
}
private fun initSearchView() { private fun initSearchView() {
ATH.setTint(searchView, primaryTextColor) ATH.setTint(searchView, primaryTextColor)
searchView.onActionViewExpanded() searchView.onActionViewExpanded()

@ -72,6 +72,11 @@ class RssFragment : VMBaseFragment<RssSourceViewModel>(R.layout.fragment_rss),
} }
} }
override fun onPause() {
super.onPause()
searchView.clearFocus()
}
private fun upGroupsMenu() = groupsMenu?.let { subMenu -> private fun upGroupsMenu() = groupsMenu?.let { subMenu ->
subMenu.removeGroup(R.id.menu_group_text) subMenu.removeGroup(R.id.menu_group_text)
groups.sortedWith { o1, o2 -> groups.sortedWith { o1, o2 ->

Loading…
Cancel
Save