From 7a7a332d35714d5d992748b99fdc177812840b12 Mon Sep 17 00:00:00 2001 From: Horis <821938089@qq.com> Date: Sat, 24 Feb 2024 09:48:17 +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/model/ReadBook.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/model/ReadBook.kt b/app/src/main/java/io/legado/app/model/ReadBook.kt index 4182b33b1..9c648dd5b 100644 --- a/app/src/main/java/io/legado/app/model/ReadBook.kt +++ b/app/src/main/java/io/legado/app/model/ReadBook.kt @@ -529,8 +529,7 @@ object ReadBook : CoroutineScope by MainScope() { .getContent(book, chapter, content, includeTitle = false) val textChapter = ChapterProvider.getTextChapterAsync(chapter, displayTitle, contents, chapterSize) - val offset = chapter.index - durChapterIndex - when (offset) { + when (val offset = chapter.index - durChapterIndex) { 0 -> { curTextChapter?.cancelLayout() curTextChapter = textChapter @@ -551,8 +550,7 @@ object ReadBook : CoroutineScope by MainScope() { available = true } if (upContent && isScroll) { - val pageIndex = durPageIndex - if (max(index - 3, 0) < pageIndex) { + if (max(index - 3, 0) < durPageIndex) { callBack?.upContent(offset, resetPageOffset) } }