pull/32/head
GKF 6 years ago
parent cbfe926db1
commit 54229d6d9b
  1. 7
      app/src/main/java/io/legado/app/ui/main/MainActivity.kt
  2. 2
      app/src/main/res/values-night/colors.xml
  3. 2
      app/src/main/res/values/colors.xml

@ -15,11 +15,13 @@ import io.legado.app.constant.Bus
import io.legado.app.help.permission.Permissions import io.legado.app.help.permission.Permissions
import io.legado.app.help.permission.PermissionsCompat import io.legado.app.help.permission.PermissionsCompat
import io.legado.app.help.storage.Restore import io.legado.app.help.storage.Restore
import io.legado.app.lib.theme.Selector
import io.legado.app.lib.theme.ThemeStore import io.legado.app.lib.theme.ThemeStore
import io.legado.app.ui.main.bookshelf.BookshelfFragment import io.legado.app.ui.main.bookshelf.BookshelfFragment
import io.legado.app.ui.main.booksource.BookSourceFragment import io.legado.app.ui.main.booksource.BookSourceFragment
import io.legado.app.ui.main.findbook.FindBookFragment import io.legado.app.ui.main.findbook.FindBookFragment
import io.legado.app.ui.main.myconfig.MyConfigFragment import io.legado.app.ui.main.myconfig.MyConfigFragment
import io.legado.app.utils.getCompatColor
import io.legado.app.utils.getViewModel import io.legado.app.utils.getViewModel
import kotlinx.android.synthetic.main.activity_main.* import kotlinx.android.synthetic.main.activity_main.*
@ -34,6 +36,11 @@ class MainActivity : BaseActivity<MainViewModel>(), BottomNavigationView.OnNavig
override fun onViewModelCreated(viewModel: MainViewModel, savedInstanceState: Bundle?) { override fun onViewModelCreated(viewModel: MainViewModel, savedInstanceState: Bundle?) {
bottom_navigation_view.setBackgroundColor(ThemeStore.backgroundColor(this)) bottom_navigation_view.setBackgroundColor(ThemeStore.backgroundColor(this))
val colorStateList = Selector.colorBuild()
.setDefaultColor(bottom_navigation_view.context.getCompatColor(R.color.btn_bg_press_tp))
.setSelectedColor(ThemeStore.primaryColor(bottom_navigation_view.context)).create()
bottom_navigation_view.itemIconTintList = colorStateList
bottom_navigation_view.itemTextColor = colorStateList
view_pager_main.offscreenPageLimit = 3 view_pager_main.offscreenPageLimit = 3
view_pager_main.adapter = TabFragmentPageAdapter(supportFragmentManager) view_pager_main.adapter = TabFragmentPageAdapter(supportFragmentManager)
view_pager_main.addOnPageChangeListener(this) view_pager_main.addOnPageChangeListener(this)

@ -11,7 +11,7 @@
<color name="bg_divider_line">#363636</color> <color name="bg_divider_line">#363636</color>
<color name="btn_bg_press">#804D4D4D</color> <color name="btn_bg_press">#804D4D4D</color>
<color name="btn_bg_press_2">#80686868</color> <color name="btn_bg_press_2">#80686868</color>
<color name="btn_bg_press_tp">#88111111</color> <color name="btn_bg_press_tp">#80C7C7C7</color>
<color name="darker_gray">#66666666</color> <color name="darker_gray">#66666666</color>
<color name="tv_btn_normal_black">#737373</color> <color name="tv_btn_normal_black">#737373</color>

@ -23,7 +23,7 @@
<color name="btn_bg_press">#80ACACAC</color> <color name="btn_bg_press">#80ACACAC</color>
<color name="btn_bg_press_2">#80858585</color> <color name="btn_bg_press_2">#80858585</color>
<color name="btn_bg_press_tp">#88000000</color> <color name="btn_bg_press_tp">#802C2C2C</color>
<color name="tv_btn_normal_black">#737373</color> <color name="tv_btn_normal_black">#737373</color>
<color name="tv_btn_press_black">#adadad</color> <color name="tv_btn_press_black">#adadad</color>

Loading…
Cancel
Save