|
|
|
@ -71,6 +71,9 @@ object ReadBook { |
|
|
|
|
appDb.bookSourceDao.getBookSource(book.origin)?.let { |
|
|
|
|
bookSource = it |
|
|
|
|
webBook = WebBook(it) |
|
|
|
|
if (book.getImageStyle().isNullOrBlank()) { |
|
|
|
|
book.setImageStyle(it.getContentRule().imageStyle) |
|
|
|
|
} |
|
|
|
|
} ?: let { |
|
|
|
|
bookSource = null |
|
|
|
|
webBook = null |
|
|
|
@ -413,7 +416,7 @@ object ReadBook { |
|
|
|
|
durChapterIndex -> { |
|
|
|
|
curTextChapter = |
|
|
|
|
ChapterProvider.getTextChapter( |
|
|
|
|
book, chapter, contents, chapterSize, imageStyle |
|
|
|
|
book, chapter, contents, chapterSize |
|
|
|
|
) |
|
|
|
|
if (upContent) callBack?.upContent(resetPageOffset = resetPageOffset) |
|
|
|
|
callBack?.upView() |
|
|
|
@ -423,14 +426,14 @@ object ReadBook { |
|
|
|
|
durChapterIndex - 1 -> { |
|
|
|
|
prevTextChapter = |
|
|
|
|
ChapterProvider.getTextChapter( |
|
|
|
|
book, chapter, contents, chapterSize, imageStyle |
|
|
|
|
book, chapter, contents, chapterSize |
|
|
|
|
) |
|
|
|
|
if (upContent) callBack?.upContent(-1, resetPageOffset) |
|
|
|
|
} |
|
|
|
|
durChapterIndex + 1 -> { |
|
|
|
|
nextTextChapter = |
|
|
|
|
ChapterProvider.getTextChapter( |
|
|
|
|
book, chapter, contents, chapterSize, imageStyle |
|
|
|
|
book, chapter, contents, chapterSize |
|
|
|
|
) |
|
|
|
|
if (upContent) callBack?.upContent(1, resetPageOffset) |
|
|
|
|
} |
|
|
|
@ -444,8 +447,6 @@ object ReadBook { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private val imageStyle get() = webBook?.bookSource?.ruleContent?.imageStyle |
|
|
|
|
|
|
|
|
|
fun pageAnim(): Int { |
|
|
|
|
book?.let { |
|
|
|
|
return if (it.getPageAnim() < 0) |
|
|
|
|