pull/51/head
kunfei 5 years ago
parent ec1057c73b
commit ae4290badc
  1. 2
      app/src/main/java/io/legado/app/ui/chapterlist/ChapterListActivity.kt
  2. 2
      app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt

@ -10,6 +10,7 @@ import androidx.fragment.app.FragmentPagerAdapter
import io.legado.app.R import io.legado.app.R
import io.legado.app.base.VMBaseActivity import io.legado.app.base.VMBaseActivity
import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.ATH
import io.legado.app.lib.theme.accentColor
import io.legado.app.lib.theme.primaryTextColor import io.legado.app.lib.theme.primaryTextColor
import io.legado.app.utils.getViewModel import io.legado.app.utils.getViewModel
import io.legado.app.utils.gone import io.legado.app.utils.gone
@ -26,6 +27,7 @@ class ChapterListActivity : VMBaseActivity<ChapterListViewModel>(R.layout.activi
override fun onActivityCreated(savedInstanceState: Bundle?) { override fun onActivityCreated(savedInstanceState: Bundle?) {
setSupportActionBar(toolbar) setSupportActionBar(toolbar)
tab_layout.setSelectedTabIndicatorColor(accentColor)
viewModel.bookUrl = intent.getStringExtra("bookUrl") viewModel.bookUrl = intent.getStringExtra("bookUrl")
viewModel.loadBook { viewModel.loadBook {
view_pager.adapter = TabFragmentPageAdapter(supportFragmentManager) view_pager.adapter = TabFragmentPageAdapter(supportFragmentManager)

@ -16,6 +16,7 @@ import io.legado.app.constant.AppConst
import io.legado.app.data.entities.BookGroup import io.legado.app.data.entities.BookGroup
import io.legado.app.lib.dialogs.selector import io.legado.app.lib.dialogs.selector
import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.ATH
import io.legado.app.lib.theme.accentColor
import io.legado.app.ui.book.search.SearchActivity import io.legado.app.ui.book.search.SearchActivity
import io.legado.app.utils.getPrefBoolean import io.legado.app.utils.getPrefBoolean
import io.legado.app.utils.getViewModel import io.legado.app.utils.getViewModel
@ -73,6 +74,7 @@ class BookshelfFragment : VMBaseFragment<BookshelfViewModel>(R.layout.fragment_b
private fun initRecyclerView() { private fun initRecyclerView() {
tab_layout.isTabIndicatorFullWidth = false tab_layout.isTabIndicatorFullWidth = false
tab_layout.tabMode = TabLayout.MODE_SCROLLABLE tab_layout.tabMode = TabLayout.MODE_SCROLLABLE
tab_layout.setSelectedTabIndicatorColor(requireContext().accentColor)
ATH.applyEdgeEffectColor(view_pager_bookshelf) ATH.applyEdgeEffectColor(view_pager_bookshelf)
view_pager_bookshelf.adapter = BookshelfAdapter(this, this) view_pager_bookshelf.adapter = BookshelfAdapter(this, this)
TabLayoutMediator(tab_layout, view_pager_bookshelf) { tab, position -> TabLayoutMediator(tab_layout, view_pager_bookshelf) { tab, position ->

Loading…
Cancel
Save