From 62e13f6a6f5cfd66e2984a750d3dea8986bf50cf Mon Sep 17 00:00:00 2001 From: Horis <821938089@qq.com> Date: Thu, 20 Oct 2022 23:58:52 +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/java/io/legado/app/help/storage/BackupConfig.kt | 3 ++- .../legado/app/ui/book/read/page/provider/TextPageFactory.kt | 4 ++-- .../main/java/io/legado/app/ui/config/BackupConfigFragment.kt | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/storage/BackupConfig.kt b/app/src/main/java/io/legado/app/help/storage/BackupConfig.kt index 9d1f3225c..4b0de9718 100644 --- a/app/src/main/java/io/legado/app/help/storage/BackupConfig.kt +++ b/app/src/main/java/io/legado/app/help/storage/BackupConfig.kt @@ -50,7 +50,8 @@ object BackupConfig { PreferKey.defaultCover, PreferKey.defaultCoverDark, PreferKey.backupPath, - PreferKey.defaultBookTreeUri + PreferKey.defaultBookTreeUri, + PreferKey.webDavDeviceName ) //阅读配置 diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/provider/TextPageFactory.kt b/app/src/main/java/io/legado/app/ui/book/read/page/provider/TextPageFactory.kt index 80ddeff08..1bceccd6a 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/provider/TextPageFactory.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/provider/TextPageFactory.kt @@ -34,7 +34,7 @@ class TextPageFactory(dataSource: DataSource) : PageFactory(dataSource } override fun moveToNext(upContent: Boolean): Boolean = with(dataSource) { - return if (hasNext()) { + return if (hasNext() && currentChapter != null) { if (currentChapter?.isLastIndex(pageIndex) == true) { ReadBook.moveToNextChapter(upContent) } else { @@ -47,7 +47,7 @@ class TextPageFactory(dataSource: DataSource) : PageFactory(dataSource } override fun moveToPrev(upContent: Boolean): Boolean = with(dataSource) { - return if (hasPrev()) { + return if (hasPrev() && currentChapter != null) { if (pageIndex <= 0) { ReadBook.moveToPrevChapter(upContent) } else { diff --git a/app/src/main/java/io/legado/app/ui/config/BackupConfigFragment.kt b/app/src/main/java/io/legado/app/ui/config/BackupConfigFragment.kt index c390af8c6..a9e645e41 100644 --- a/app/src/main/java/io/legado/app/ui/config/BackupConfigFragment.kt +++ b/app/src/main/java/io/legado/app/ui/config/BackupConfigFragment.kt @@ -185,6 +185,7 @@ class BackupConfigFragment : PreferenceFragment(), upPreferenceSummary(key, getPrefString(key)) viewModel.upWebDavConfig() } + PreferKey.webDavDeviceName -> upPreferenceSummary(key, getPrefString(key)) } }