From 7523131756108e19e8d48b425704d0b60609c8d0 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 1 Dec 2019 19:14:41 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/ui/main/MainActivity.kt | 9 ++------- 1 file changed, 2 insertions(+), 7 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 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() } }