|
|
|
@ -46,7 +46,7 @@ class MainActivity : VMBaseActivity<MainViewModel>(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<MainViewModel>(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<MainViewModel>(R.layout.activity_main), |
|
|
|
|
content_view.upStyle() |
|
|
|
|
} |
|
|
|
|
observeEvent<String>(PreferKey.showRss) { |
|
|
|
|
upShowRss() |
|
|
|
|
recreate() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|