|
|
@ -16,7 +16,6 @@ import io.legado.app.constant.PreferKey |
|
|
|
import io.legado.app.help.AppConfig |
|
|
|
import io.legado.app.help.AppConfig |
|
|
|
import io.legado.app.help.ReadBookConfig |
|
|
|
import io.legado.app.help.ReadBookConfig |
|
|
|
import io.legado.app.lib.theme.ATH |
|
|
|
import io.legado.app.lib.theme.ATH |
|
|
|
import io.legado.app.lib.theme.ThemeStore |
|
|
|
|
|
|
|
import io.legado.app.service.WebService |
|
|
|
import io.legado.app.service.WebService |
|
|
|
import io.legado.app.ui.about.AboutActivity |
|
|
|
import io.legado.app.ui.about.AboutActivity |
|
|
|
import io.legado.app.ui.about.DonateActivity |
|
|
|
import io.legado.app.ui.about.DonateActivity |
|
|
@ -128,10 +127,10 @@ class MyFragment : BaseFragment(R.layout.fragment_my_config), FileChooserDialog. |
|
|
|
if (AppConfig.isEInkMode) { |
|
|
|
if (AppConfig.isEInkMode) { |
|
|
|
//保存开启前的设置 |
|
|
|
//保存开启前的设置 |
|
|
|
putPrefInt(PreferKey.lastPageAnim, ReadBookConfig.pageAnim) |
|
|
|
putPrefInt(PreferKey.lastPageAnim, ReadBookConfig.pageAnim) |
|
|
|
putPrefInt(PreferKey.cLPrimary, ThemeStore.primaryColor()) |
|
|
|
putPrefInt(PreferKey.cLPrimary, getPrefInt(PreferKey.cPrimary)) |
|
|
|
putPrefInt(PreferKey.cLAccent, ThemeStore.accentColor()) |
|
|
|
putPrefInt(PreferKey.cLAccent, getPrefInt(PreferKey.cAccent)) |
|
|
|
putPrefInt(PreferKey.cLBackground, ThemeStore.backgroundColor()) |
|
|
|
putPrefInt(PreferKey.cLBackground, getPrefInt(PreferKey.cBackground)) |
|
|
|
putPrefInt(PreferKey.cLBBackground, ThemeStore.bottomBackground()) |
|
|
|
putPrefInt(PreferKey.cLBBackground, getPrefInt(PreferKey.cBBackground)) |
|
|
|
putPrefBoolean(PreferKey.lastIsNight, AppConfig.isNightTheme) |
|
|
|
putPrefBoolean(PreferKey.lastIsNight, AppConfig.isNightTheme) |
|
|
|
putPrefString( |
|
|
|
putPrefString( |
|
|
|
PreferKey.lastThemeMode, |
|
|
|
PreferKey.lastThemeMode, |
|
|
@ -147,21 +146,16 @@ class MyFragment : BaseFragment(R.layout.fragment_my_config), FileChooserDialog. |
|
|
|
AppConfig.isNightTheme = false |
|
|
|
AppConfig.isNightTheme = false |
|
|
|
App.INSTANCE.applyDayNight() |
|
|
|
App.INSTANCE.applyDayNight() |
|
|
|
postEvent(EventBus.RECREATE, "") |
|
|
|
postEvent(EventBus.RECREATE, "") |
|
|
|
} else if (getPrefString(PreferKey.themeMode) != null) { |
|
|
|
} else if (getPrefString(PreferKey.lastThemeMode) != null) { |
|
|
|
ReadBookConfig.pageAnim = getPrefInt(PreferKey.lastPageAnim) |
|
|
|
ReadBookConfig.pageAnim = getPrefInt(PreferKey.lastPageAnim) |
|
|
|
val isNightTheme = getPrefBoolean(PreferKey.lastIsNight) |
|
|
|
putPrefInt(PreferKey.cPrimary, getPrefInt(PreferKey.cLPrimary)) |
|
|
|
if (isNightTheme) { |
|
|
|
putPrefInt(PreferKey.cAccent, getPrefInt(PreferKey.cLAccent)) |
|
|
|
putPrefInt(PreferKey.cNPrimary, getPrefInt(PreferKey.cLPrimary)) |
|
|
|
putPrefInt(PreferKey.cBackground, getPrefInt(PreferKey.cLBackground)) |
|
|
|
putPrefInt(PreferKey.cNAccent, getPrefInt(PreferKey.cLAccent)) |
|
|
|
putPrefInt(PreferKey.cBBackground, getPrefInt(PreferKey.cLBBackground)) |
|
|
|
putPrefInt(PreferKey.cNBackground, getPrefInt(PreferKey.cLBackground)) |
|
|
|
putPrefString( |
|
|
|
putPrefInt(PreferKey.cNBBackground, getPrefInt(PreferKey.cLBBackground)) |
|
|
|
PreferKey.themeMode, |
|
|
|
} else { |
|
|
|
getPrefString(PreferKey.lastThemeMode) ?: "0" |
|
|
|
putPrefInt(PreferKey.cPrimary, getPrefInt(PreferKey.cLPrimary)) |
|
|
|
) |
|
|
|
putPrefInt(PreferKey.cAccent, getPrefInt(PreferKey.cLAccent)) |
|
|
|
|
|
|
|
putPrefInt(PreferKey.cBackground, getPrefInt(PreferKey.cLBackground)) |
|
|
|
|
|
|
|
putPrefInt(PreferKey.cBBackground, getPrefInt(PreferKey.cLBBackground)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
AppConfig.isNightTheme = isNightTheme |
|
|
|
|
|
|
|
App.INSTANCE.applyDayNight() |
|
|
|
App.INSTANCE.applyDayNight() |
|
|
|
postEvent(EventBus.RECREATE, "") |
|
|
|
postEvent(EventBus.RECREATE, "") |
|
|
|
} |
|
|
|
} |
|
|
|