pull/94/head 3.20.020810
kunfei 5 years ago
parent 6077117210
commit 37a560eb39
  1. 4
      app/src/main/java/io/legado/app/ui/main/MainActivity.kt

@ -38,6 +38,7 @@ class MainActivity : VMBaseActivity<MainViewModel>(R.layout.activity_main),
private var pagePosition = 0 private var pagePosition = 0
private val fragmentList = arrayListOf<Fragment>() private val fragmentList = arrayListOf<Fragment>()
private var rssFragment: RssFragment? = null
override fun onActivityCreated(savedInstanceState: Bundle?) { override fun onActivityCreated(savedInstanceState: Bundle?) {
ATH.applyEdgeEffectColor(view_pager_main) ATH.applyEdgeEffectColor(view_pager_main)
@ -69,7 +70,8 @@ class MainActivity : VMBaseActivity<MainViewModel>(R.layout.activity_main),
fragmentList.add(MyFragment()) fragmentList.add(MyFragment())
} }
if (AppConfig.isShowRSS && fragmentList.size < 4) { if (AppConfig.isShowRSS && fragmentList.size < 4) {
fragmentList.add(2, RssFragment()) fragmentList.add(2,
rssFragment ?: RssFragment().apply { rssFragment = this })
} }
if (!AppConfig.isShowRSS && fragmentList.size == 4) { if (!AppConfig.isShowRSS && fragmentList.size == 4) {
fragmentList.removeAt(2) fragmentList.removeAt(2)

Loading…
Cancel
Save