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