From 54229d6d9bbef054ce32621d71b399ce664a7418 Mon Sep 17 00:00:00 2001 From: GKF Date: Tue, 11 Jun 2019 09:29:52 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/ui/main/MainActivity.kt | 7 +++++++ app/src/main/res/values-night/colors.xml | 2 +- app/src/main/res/values/colors.xml | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt index 973380645..c2a1b2f77 100644 --- a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt +++ b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt @@ -15,11 +15,13 @@ import io.legado.app.constant.Bus import io.legado.app.help.permission.Permissions import io.legado.app.help.permission.PermissionsCompat 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.ui.main.bookshelf.BookshelfFragment import io.legado.app.ui.main.booksource.BookSourceFragment import io.legado.app.ui.main.findbook.FindBookFragment import io.legado.app.ui.main.myconfig.MyConfigFragment +import io.legado.app.utils.getCompatColor import io.legado.app.utils.getViewModel import kotlinx.android.synthetic.main.activity_main.* @@ -34,6 +36,11 @@ class MainActivity : BaseActivity(), BottomNavigationView.OnNavig override fun onViewModelCreated(viewModel: MainViewModel, savedInstanceState: Bundle?) { 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.adapter = TabFragmentPageAdapter(supportFragmentManager) view_pager_main.addOnPageChangeListener(this) diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml index 465af3a30..2e4227f8b 100644 --- a/app/src/main/res/values-night/colors.xml +++ b/app/src/main/res/values-night/colors.xml @@ -11,7 +11,7 @@ #363636 #804D4D4D #80686868 - #88111111 + #80C7C7C7 #66666666 #737373 diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 1098650d7..45265daac 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -23,7 +23,7 @@ #80ACACAC #80858585 - #88000000 + #802C2C2C #737373 #adadad