This commit is contained in:
Horis
2022-10-20 23:58:52 +08:00
parent f17ed81b95
commit 1e2affbf8d
3 changed files with 5 additions and 3 deletions
@@ -50,7 +50,8 @@ object BackupConfig {
PreferKey.defaultCover, PreferKey.defaultCover,
PreferKey.defaultCoverDark, PreferKey.defaultCoverDark,
PreferKey.backupPath, PreferKey.backupPath,
PreferKey.defaultBookTreeUri PreferKey.defaultBookTreeUri,
PreferKey.webDavDeviceName
) )
//阅读配置 //阅读配置
@@ -34,7 +34,7 @@ class TextPageFactory(dataSource: DataSource) : PageFactory<TextPage>(dataSource
} }
override fun moveToNext(upContent: Boolean): Boolean = with(dataSource) { override fun moveToNext(upContent: Boolean): Boolean = with(dataSource) {
return if (hasNext()) { return if (hasNext() && currentChapter != null) {
if (currentChapter?.isLastIndex(pageIndex) == true) { if (currentChapter?.isLastIndex(pageIndex) == true) {
ReadBook.moveToNextChapter(upContent) ReadBook.moveToNextChapter(upContent)
} else { } else {
@@ -47,7 +47,7 @@ class TextPageFactory(dataSource: DataSource) : PageFactory<TextPage>(dataSource
} }
override fun moveToPrev(upContent: Boolean): Boolean = with(dataSource) { override fun moveToPrev(upContent: Boolean): Boolean = with(dataSource) {
return if (hasPrev()) { return if (hasPrev() && currentChapter != null) {
if (pageIndex <= 0) { if (pageIndex <= 0) {
ReadBook.moveToPrevChapter(upContent) ReadBook.moveToPrevChapter(upContent)
} else { } else {
@@ -185,6 +185,7 @@ class BackupConfigFragment : PreferenceFragment(),
upPreferenceSummary(key, getPrefString(key)) upPreferenceSummary(key, getPrefString(key))
viewModel.upWebDavConfig() viewModel.upWebDavConfig()
} }
PreferKey.webDavDeviceName -> upPreferenceSummary(key, getPrefString(key))
} }
} }