|
|
@ -24,10 +24,8 @@ import io.legado.app.ui.main.bookshelf.BookshelfFragment |
|
|
|
import io.legado.app.ui.main.explore.ExploreFragment |
|
|
|
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.page.ChapterProvider |
|
|
|
|
|
|
|
import io.legado.app.utils.* |
|
|
|
import io.legado.app.utils.* |
|
|
|
import kotlinx.android.synthetic.main.activity_main.* |
|
|
|
import kotlinx.android.synthetic.main.activity_main.* |
|
|
|
import kotlinx.android.synthetic.main.view_book_page.* |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MainActivity : VMBaseActivity<MainViewModel>(R.layout.activity_main), |
|
|
|
class MainActivity : VMBaseActivity<MainViewModel>(R.layout.activity_main), |
|
|
|
BottomNavigationView.OnNavigationItemSelectedListener, |
|
|
|
BottomNavigationView.OnNavigationItemSelectedListener, |
|
|
@ -40,7 +38,6 @@ class MainActivity : VMBaseActivity<MainViewModel>(R.layout.activity_main), |
|
|
|
private val fragmentList = arrayListOf<Fragment>() |
|
|
|
private val fragmentList = arrayListOf<Fragment>() |
|
|
|
|
|
|
|
|
|
|
|
override fun onActivityCreated(savedInstanceState: Bundle?) { |
|
|
|
override fun onActivityCreated(savedInstanceState: Bundle?) { |
|
|
|
ChapterProvider.textView = content_text_view |
|
|
|
|
|
|
|
ATH.applyEdgeEffectColor(view_pager_main) |
|
|
|
ATH.applyEdgeEffectColor(view_pager_main) |
|
|
|
ATH.applyBottomNavigationColor(bottom_navigation_view) |
|
|
|
ATH.applyBottomNavigationColor(bottom_navigation_view) |
|
|
|
view_pager_main.offscreenPageLimit = 3 |
|
|
|
view_pager_main.offscreenPageLimit = 3 |
|
|
@ -136,9 +133,6 @@ class MainActivity : VMBaseActivity<MainViewModel>(R.layout.activity_main), |
|
|
|
observeEvent<String>(Bus.RECREATE) { |
|
|
|
observeEvent<String>(Bus.RECREATE) { |
|
|
|
recreate() |
|
|
|
recreate() |
|
|
|
} |
|
|
|
} |
|
|
|
observeEvent<Boolean>(Bus.UP_CONFIG) { |
|
|
|
|
|
|
|
content_view.upStyle() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
observeEvent<String>(PreferKey.showRss) { |
|
|
|
observeEvent<String>(PreferKey.showRss) { |
|
|
|
bottom_navigation_view.menu.findItem(R.id.menu_rss).isVisible = showRss() |
|
|
|
bottom_navigation_view.menu.findItem(R.id.menu_rss).isVisible = showRss() |
|
|
|
upFragmentList() |
|
|
|
upFragmentList() |
|
|
|