From bb0e4c6b984fab490c811ef1694a108512dbc6ad Mon Sep 17 00:00:00 2001 From: gedoor Date: Thu, 18 Jun 2020 21:51:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=B8=8B=E8=BD=BD=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=86=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/main/my/MyFragment.kt | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt b/app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt index 0a59c49c1..122f787eb 100644 --- a/app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt @@ -145,10 +145,23 @@ class MyFragment : BaseFragment(R.layout.fragment_my_config), FileChooserDialog. postEvent(EventBus.RECREATE, "") } else { ReadBookConfig.pageAnim = getPrefInt("lastReadBookPageAnim") - putPrefInt("colorPrimary", getPrefInt("lastColorPrimary")) - putPrefInt("colorAccent", getPrefInt("lastColorAccent")) - putPrefInt("colorBackground", getPrefInt("lastColorBackground")) - putPrefInt("colorBottomBackground", getPrefInt("lastColorBottomBackground")) + if (getPrefBoolean("lastIsNightTheme")) { + putPrefInt("colorPrimaryNight", getPrefInt("lastColorPrimary")) + putPrefInt("colorAccentNight", getPrefInt("lastColorAccent")) + putPrefInt("colorBackgroundNight", getPrefInt("lastColorBackground")) + putPrefInt( + "colorBottomBackgroundNight", + getPrefInt("lastColorBottomBackground") + ) + } else { + putPrefInt("colorPrimary", getPrefInt("lastColorPrimary")) + putPrefInt("colorAccent", getPrefInt("lastColorAccent")) + putPrefInt("colorBackground", getPrefInt("lastColorBackground")) + putPrefInt( + "colorBottomBackground", + getPrefInt("lastColorBottomBackground") + ) + } AppConfig.isNightTheme = getPrefBoolean("lastIsNightTheme") App.INSTANCE.applyDayNight() postEvent(EventBus.RECREATE, "")