|
|
@ -123,46 +123,45 @@ class MyFragment : BaseFragment(R.layout.fragment_my_config), FileChooserDialog. |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
"recordLog" -> LogUtils.upLevel() |
|
|
|
"recordLog" -> LogUtils.upLevel() |
|
|
|
PreferKey.einkMode -> { |
|
|
|
PreferKey.eInkMode -> { |
|
|
|
//既然是 E-Ink 模式,为什么不一步到位呢 |
|
|
|
//既然是 E-Ink 模式,为什么不一步到位呢 |
|
|
|
if (AppConfig.isEInkMode) { |
|
|
|
if (AppConfig.isEInkMode) { |
|
|
|
//保存开启前的设置 |
|
|
|
//保存开启前的设置 |
|
|
|
putPrefInt("lastReadBookPageAnim", ReadBookConfig.pageAnim) |
|
|
|
putPrefInt(PreferKey.lastPageAnim, ReadBookConfig.pageAnim) |
|
|
|
putPrefInt("lastColorPrimary", ThemeStore.primaryColor(requireContext())) |
|
|
|
putPrefInt(PreferKey.cLPrimary, ThemeStore.primaryColor()) |
|
|
|
putPrefInt("lastColorAccent", ThemeStore.accentColor(requireContext())) |
|
|
|
putPrefInt(PreferKey.cLAccent, ThemeStore.accentColor()) |
|
|
|
putPrefInt("lastColorBackground", ThemeStore.backgroundColor(requireContext())) |
|
|
|
putPrefInt(PreferKey.cLBackground, ThemeStore.backgroundColor()) |
|
|
|
putPrefInt("lastColorBottomBackground", ThemeStore.bottomBackground(requireContext())) |
|
|
|
putPrefInt(PreferKey.cLBBackground, ThemeStore.bottomBackground()) |
|
|
|
putPrefBoolean("lastIsNightTheme", AppConfig.isNightTheme) |
|
|
|
putPrefBoolean(PreferKey.lastIsNight, AppConfig.isNightTheme) |
|
|
|
|
|
|
|
putPrefString( |
|
|
|
|
|
|
|
PreferKey.lastThemeMode, |
|
|
|
|
|
|
|
getPrefString(PreferKey.themeMode) ?: "0" |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
//设置 E-Ink 模式配置 |
|
|
|
//设置 E-Ink 模式配置 |
|
|
|
ReadBookConfig.pageAnim = 4 |
|
|
|
ReadBookConfig.pageAnim = 4 |
|
|
|
putPrefInt("colorPrimary", getCompatColor(R.color.white)) |
|
|
|
putPrefInt(PreferKey.cPrimary, getCompatColor(R.color.white)) |
|
|
|
putPrefInt("colorAccent", getCompatColor(R.color.black)) |
|
|
|
putPrefInt(PreferKey.cAccent, getCompatColor(R.color.black)) |
|
|
|
putPrefInt("colorBackground", getCompatColor(R.color.white)) |
|
|
|
putPrefInt(PreferKey.cBackground, getCompatColor(R.color.white)) |
|
|
|
putPrefInt("colorBottomBackground", getCompatColor(R.color.white)) |
|
|
|
putPrefInt(PreferKey.cBBackground, getCompatColor(R.color.white)) |
|
|
|
AppConfig.isNightTheme = false |
|
|
|
AppConfig.isNightTheme = false |
|
|
|
App.INSTANCE.applyDayNight() |
|
|
|
App.INSTANCE.applyDayNight() |
|
|
|
postEvent(EventBus.RECREATE, "") |
|
|
|
postEvent(EventBus.RECREATE, "") |
|
|
|
|
|
|
|
} else if (getPrefString(PreferKey.themeMode) != null) { |
|
|
|
|
|
|
|
ReadBookConfig.pageAnim = getPrefInt(PreferKey.lastPageAnim) |
|
|
|
|
|
|
|
val isNightTheme = getPrefBoolean(PreferKey.lastIsNight) |
|
|
|
|
|
|
|
if (isNightTheme) { |
|
|
|
|
|
|
|
putPrefInt(PreferKey.cNPrimary, getPrefInt(PreferKey.cLPrimary)) |
|
|
|
|
|
|
|
putPrefInt(PreferKey.cNAccent, getPrefInt(PreferKey.cLAccent)) |
|
|
|
|
|
|
|
putPrefInt(PreferKey.cNBackground, getPrefInt(PreferKey.cLBackground)) |
|
|
|
|
|
|
|
putPrefInt(PreferKey.cNBBackground, getPrefInt(PreferKey.cLBBackground)) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
ReadBookConfig.pageAnim = getPrefInt("lastReadBookPageAnim") |
|
|
|
putPrefInt(PreferKey.cPrimary, getPrefInt(PreferKey.cLPrimary)) |
|
|
|
if (getPrefBoolean("lastIsNightTheme")) { |
|
|
|
putPrefInt(PreferKey.cAccent, getPrefInt(PreferKey.cLAccent)) |
|
|
|
putPrefInt("colorPrimaryNight", getPrefInt("lastColorPrimary")) |
|
|
|
putPrefInt(PreferKey.cBackground, getPrefInt(PreferKey.cLBackground)) |
|
|
|
putPrefInt("colorAccentNight", getPrefInt("lastColorAccent")) |
|
|
|
putPrefInt(PreferKey.cBBackground, getPrefInt(PreferKey.cLBBackground)) |
|
|
|
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") |
|
|
|
AppConfig.isNightTheme = isNightTheme |
|
|
|
App.INSTANCE.applyDayNight() |
|
|
|
App.INSTANCE.applyDayNight() |
|
|
|
postEvent(EventBus.RECREATE, "") |
|
|
|
postEvent(EventBus.RECREATE, "") |
|
|
|
} |
|
|
|
} |
|
|
|