From 722497f5992b8572574ec419f032393c0fd2a3f3 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 4 Mar 2020 13:48:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/help/storage/Restore.kt | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/storage/Restore.kt b/app/src/main/java/io/legado/app/help/storage/Restore.kt index 850724743..8fb24a11e 100644 --- a/app/src/main/java/io/legado/app/help/storage/Restore.kt +++ b/app/src/main/java/io/legado/app/help/storage/Restore.kt @@ -8,6 +8,7 @@ import com.jayway.jsonpath.JsonPath import com.jayway.jsonpath.Option import com.jayway.jsonpath.ParseContext import io.legado.app.App +import io.legado.app.BuildConfig import io.legado.app.constant.PreferKey import io.legado.app.data.entities.* import io.legado.app.help.LauncherIconHelp @@ -108,22 +109,24 @@ object Restore { } edit.putInt(PreferKey.versionCode, App.INSTANCE.versionCode) edit.apply() - } - ReadBookConfig.apply { - styleSelect = App.INSTANCE.getPrefInt(PreferKey.readStyleSelect) - shareLayout = App.INSTANCE.getPrefBoolean(PreferKey.shareLayout) - pageAnim = App.INSTANCE.getPrefInt(PreferKey.pageAnim) - hideStatusBar = App.INSTANCE.getPrefBoolean(PreferKey.hideStatusBar) - hideNavigationBar = App.INSTANCE.getPrefBoolean(PreferKey.hideNavigationBar) - bodyIndentCount = App.INSTANCE.getPrefInt(PreferKey.bodyIndent, 2) - } - ChapterProvider.upStyle() - ReadBook.loadContent() - withContext(Main) { - App.INSTANCE.applyDayNight() + ReadBookConfig.apply { + styleSelect = App.INSTANCE.getPrefInt(PreferKey.readStyleSelect) + shareLayout = App.INSTANCE.getPrefBoolean(PreferKey.shareLayout) + pageAnim = App.INSTANCE.getPrefInt(PreferKey.pageAnim) + hideStatusBar = App.INSTANCE.getPrefBoolean(PreferKey.hideStatusBar) + hideNavigationBar = App.INSTANCE.getPrefBoolean(PreferKey.hideNavigationBar) + bodyIndentCount = App.INSTANCE.getPrefInt(PreferKey.bodyIndent, 2) + } + ChapterProvider.upStyle() + ReadBook.loadContent() + withContext(Main) { + App.INSTANCE.applyDayNight() + } + if (!BuildConfig.DEBUG) + LauncherIconHelp.changeIcon(App.INSTANCE.getPrefString(PreferKey.launcherIcon)) } } - LauncherIconHelp.changeIcon(App.INSTANCE.getPrefString(PreferKey.launcherIcon)) + } private inline fun fileToListT(path: String, fileName: String): List? {