From 32218d7e27a49579c64270d3e7f5cc7a76fe9567 Mon Sep 17 00:00:00 2001 From: gedoor Date: Fri, 11 Sep 2020 11:16:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/assets/readConfig.json | 10 ++++++++++ app/src/main/java/io/legado/app/help/ReadBookConfig.kt | 10 +++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/app/src/main/assets/readConfig.json b/app/src/main/assets/readConfig.json index 968141a0c..c94ecda3b 100644 --- a/app/src/main/assets/readConfig.json +++ b/app/src/main/assets/readConfig.json @@ -1,4 +1,14 @@ [ + { + "bgStr": "#FFFFFF", + "bgStrNight": "#000000", + "textColor": "#000000", + "textColorNight": "#FFFFFF", + "bgType": 0, + "bgTypeNight": 0, + "darkStatusIcon": true, + "darkStatusIconNight": false + }, { "bgStr": "#FFFFFF", "bgStrNight": "#000000", diff --git a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt index 9d249fe2a..0472bed7c 100644 --- a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt +++ b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt @@ -28,9 +28,9 @@ object ReadBookConfig { GSON.fromJsonArray(json)!! } var durConfig - get() = getConfig(styleSelect) + get() = getConfig(styleSelect + 1) set(value) { - configList[styleSelect] = value + configList[styleSelect + 1] = value if (shareLayout) { configList[5] = value } @@ -51,7 +51,7 @@ object ReadBookConfig { resetAll() } if (configList.size < 6) { - configList.add(Config()) + configList.add(0, Config()) } return configList[index] } @@ -160,7 +160,7 @@ object ReadBookConfig { var hideStatusBar = App.INSTANCE.getPrefBoolean(PreferKey.hideStatusBar) 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 get() = config.textFont @@ -308,7 +308,7 @@ object ReadBookConfig { fun getExportConfig(): Config { val exportConfig = GSON.fromJsonObject(GSON.toJson(durConfig))!! if (shareLayout) { - val shearConfig = getConfig(5) + val shearConfig = getConfig(0) exportConfig.textFont = shearConfig.textFont exportConfig.textBold = shearConfig.textBold exportConfig.textSize = shearConfig.textSize