pull/371/head
gedoor 4 years ago
parent 340b509c72
commit 32218d7e27
  1. 10
      app/src/main/assets/readConfig.json
  2. 10
      app/src/main/java/io/legado/app/help/ReadBookConfig.kt

@ -1,4 +1,14 @@
[ [
{
"bgStr": "#FFFFFF",
"bgStrNight": "#000000",
"textColor": "#000000",
"textColorNight": "#FFFFFF",
"bgType": 0,
"bgTypeNight": 0,
"darkStatusIcon": true,
"darkStatusIconNight": false
},
{ {
"bgStr": "#FFFFFF", "bgStr": "#FFFFFF",
"bgStrNight": "#000000", "bgStrNight": "#000000",

@ -28,9 +28,9 @@ object ReadBookConfig {
GSON.fromJsonArray<Config>(json)!! GSON.fromJsonArray<Config>(json)!!
} }
var durConfig var durConfig
get() = getConfig(styleSelect) get() = getConfig(styleSelect + 1)
set(value) { set(value) {
configList[styleSelect] = value configList[styleSelect + 1] = value
if (shareLayout) { if (shareLayout) {
configList[5] = value configList[5] = value
} }
@ -51,7 +51,7 @@ object ReadBookConfig {
resetAll() resetAll()
} }
if (configList.size < 6) { if (configList.size < 6) {
configList.add(Config()) configList.add(0, Config())
} }
return configList[index] return configList[index]
} }
@ -160,7 +160,7 @@ object ReadBookConfig {
var hideStatusBar = App.INSTANCE.getPrefBoolean(PreferKey.hideStatusBar) var hideStatusBar = App.INSTANCE.getPrefBoolean(PreferKey.hideStatusBar)
var hideNavigationBar = App.INSTANCE.getPrefBoolean(PreferKey.hideNavigationBar) var hideNavigationBar = App.INSTANCE.getPrefBoolean(PreferKey.hideNavigationBar)
val config get() = if (shareLayout) getConfig(5) else durConfig val config get() = if (shareLayout) getConfig(0) else durConfig
var textFont: String var textFont: String
get() = config.textFont get() = config.textFont
@ -308,7 +308,7 @@ object ReadBookConfig {
fun getExportConfig(): Config { fun getExportConfig(): Config {
val exportConfig = GSON.fromJsonObject<Config>(GSON.toJson(durConfig))!! val exportConfig = GSON.fromJsonObject<Config>(GSON.toJson(durConfig))!!
if (shareLayout) { if (shareLayout) {
val shearConfig = getConfig(5) val shearConfig = getConfig(0)
exportConfig.textFont = shearConfig.textFont exportConfig.textFont = shearConfig.textFont
exportConfig.textBold = shearConfig.textBold exportConfig.textBold = shearConfig.textBold
exportConfig.textSize = shearConfig.textSize exportConfig.textSize = shearConfig.textSize

Loading…
Cancel
Save