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)) }