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 5d5002f13..fccddec44 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 @@ -46,7 +46,7 @@ class MainActivity : VMBaseActivity(R.layout.activity_main), view_pager_main.adapter = TabFragmentPageAdapter(supportFragmentManager) view_pager_main.addOnPageChangeListener(this) bottom_navigation_view.setOnNavigationItemSelectedListener(this) - upShowRss() + bottom_navigation_view.menu.findItem(R.id.menu_rss).isVisible = showRss() upVersion() } @@ -60,11 +60,6 @@ class MainActivity : VMBaseActivity(R.layout.activity_main), return false } - private fun upShowRss() { - bottom_navigation_view.menu.findItem(R.id.menu_rss).isVisible = showRss() - view_pager_main.adapter?.notifyDataSetChanged() - } - private fun upVersion() { if (getPrefInt("versionCode") != App.INSTANCE.versionCode) { putPrefInt("versionCode", App.INSTANCE.versionCode) @@ -128,7 +123,7 @@ class MainActivity : VMBaseActivity(R.layout.activity_main), content_view.upStyle() } observeEvent(PreferKey.showRss) { - upShowRss() + recreate() } }