From 7087d9f2f41beafa884ac51f6ed10f1f90ba6594 Mon Sep 17 00:00:00 2001 From: gedoor Date: Sat, 4 Jul 2020 11:22:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E5=A4=8D=E6=BB=9A=E5=8A=A8?= =?UTF-8?q?=E7=BF=BB=E9=A1=B5bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/help/ReadBookConfig.kt | 4 +++- .../main/java/io/legado/app/help/storage/Restore.kt | 11 ++--------- 2 files changed, 5 insertions(+), 10 deletions(-) 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 3664a3be8..9476cf936 100644 --- a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt +++ b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt @@ -90,6 +90,7 @@ object ReadBookConfig { } } } + isScroll = pageAnim == 3 } fun save() { @@ -140,8 +141,9 @@ object ReadBookConfig { get() = if (AppConfig.isEInkMode) -1 else App.INSTANCE.getPrefInt(PreferKey.pageAnim) set(value) { App.INSTANCE.putPrefInt(PreferKey.pageAnim, value) + isScroll = pageAnim == 3 } - val isScroll get() = pageAnim == 3 + var isScroll = pageAnim == 3 val clickTurnPage get() = App.INSTANCE.getPrefBoolean(PreferKey.clickTurnPage, true) val textFullJustify get() = App.INSTANCE.getPrefBoolean(PreferKey.textFullJustify, true) val textBottomJustify get() = App.INSTANCE.getPrefBoolean(PreferKey.textBottomJustify, true) 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 c92f408bd..058e22933 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 @@ -2,7 +2,6 @@ package io.legado.app.help.storage import android.content.Context import android.net.Uri -import androidx.appcompat.app.AppCompatDelegate import androidx.documentfile.provider.DocumentFile import com.jayway.jsonpath.Configuration import com.jayway.jsonpath.JsonPath @@ -13,7 +12,6 @@ import io.legado.app.BuildConfig import io.legado.app.constant.EventBus import io.legado.app.constant.PreferKey import io.legado.app.data.entities.* -import io.legado.app.help.AppConfig import io.legado.app.help.LauncherIconHelp import io.legado.app.help.ReadBookConfig import io.legado.app.service.help.ReadBook @@ -132,13 +130,8 @@ object Restore { ReadBook.loadContent(resetPageOffset = false) } withContext(Main) { - if (AppConfig.isNightTheme && AppCompatDelegate.getDefaultNightMode() != AppCompatDelegate.MODE_NIGHT_YES) { - App.INSTANCE.applyDayNight() - } else if (!AppConfig.isNightTheme && AppCompatDelegate.getDefaultNightMode() == AppCompatDelegate.MODE_NIGHT_YES) { - App.INSTANCE.applyDayNight() - } else { - postEvent(EventBus.RECREATE, "true") - } + App.INSTANCE.applyDayNight() + postEvent(EventBus.RECREATE, "true") if (!BuildConfig.DEBUG) { LauncherIconHelp.changeIcon(App.INSTANCE.getPrefString(PreferKey.launcherIcon)) }