pull/1198/head
gedoor 3 years ago
parent 2567829363
commit 5da100a09c
  1. 8
      app/src/main/java/io/legado/app/service/help/ReadBook.kt

@ -416,21 +416,21 @@ object ReadBook {
.getContent(book, chapter.title, content) .getContent(book, chapter.title, content)
val textChapter = ChapterProvider val textChapter = ChapterProvider
.getTextChapter(book, chapter, contents, chapterSize) .getTextChapter(book, chapter, contents, chapterSize)
when (val offset = chapter.index - durChapterIndex) {
val offset = chapter.index - durChapterIndex
if (upContent) callBack?.upContent(offset, resetPageOffset)
when (offset) {
0 -> { 0 -> {
curTextChapter = textChapter curTextChapter = textChapter
if (upContent) callBack?.upContent(offset, resetPageOffset)
callBack?.upView() callBack?.upView()
curPageChanged() curPageChanged()
callBack?.contentLoadFinish() callBack?.contentLoadFinish()
} }
-1 -> { -1 -> {
prevTextChapter = textChapter prevTextChapter = textChapter
if (upContent) callBack?.upContent(offset, resetPageOffset)
} }
1 -> { 1 -> {
nextTextChapter = textChapter nextTextChapter = textChapter
if (upContent) callBack?.upContent(offset, resetPageOffset)
} }
} }
} }

Loading…
Cancel
Save