Horis 2 лет назад
Родитель
Сommit
d8cb021e1a

+ 4 - 4
app/src/main/java/io/legado/app/model/ReadBook.kt

@@ -232,11 +232,11 @@ object ReadBook : CoroutineScope by MainScope() {
             nextTextChapter = null
             if (curTextChapter == null) {
                 AppLog.putDebug("moveToNextChapter-章节未加载,开始加载")
-                if (upContentInPlace) callBack?.upContent(resetPageOffset = false)
+                if (upContentInPlace) callBack?.upContent()
                 loadContent(durChapterIndex, upContent, resetPageOffset = false)
             } else if (upContent && upContentInPlace) {
                 AppLog.putDebug("moveToNextChapter-章节已加载,刷新视图")
-                callBack?.upContent(resetPageOffset = false)
+                callBack?.upContent()
             }
             loadContent(durChapterIndex.plus(1), upContent, false)
             saveRead()
@@ -263,10 +263,10 @@ object ReadBook : CoroutineScope by MainScope() {
             curTextChapter = prevTextChapter
             prevTextChapter = null
             if (curTextChapter == null) {
-                if (upContentInPlace) callBack?.upContent(resetPageOffset = false)
+                if (upContentInPlace) callBack?.upContent()
                 loadContent(durChapterIndex, upContent, resetPageOffset = false)
             } else if (upContent && upContentInPlace) {
-                callBack?.upContent(resetPageOffset = false)
+                callBack?.upContent()
             }
             loadContent(durChapterIndex.minus(1), upContent, false)
             saveRead()

+ 7 - 7
app/src/main/java/io/legado/app/ui/book/read/page/provider/TextChapterLayout.kt

@@ -336,6 +336,10 @@ class TextChapterLayout(
                     }
                     if (durY + height > visibleHeight) {
                         val textPage = pendingTextPage
+                        // 双页的 durY 不正确,可能会小于实际高度
+                        if (textPage.height < durY) {
+                            textPage.height = durY
+                        }
                         if (doublePage && absStartX < viewWidth / 2) {
                             //当前页面左列结束
                             textPage.leftLineSize = textPage.lineSize
@@ -352,10 +356,6 @@ class TextChapterLayout(
                             onPageCompleted()
                             pendingTextPage = TextPage()
                         }
-                        // 双页的 durY 不正确,可能会小于实际高度
-                        if (textPage.height < durY) {
-                            textPage.height = durY
-                        }
                         durY = 0f
                     }
                 }
@@ -434,6 +434,9 @@ class TextChapterLayout(
             val textLine = TextLine(isTitle = isTitle)
             if (durY + textHeight > visibleHeight) {
                 val textPage = pendingTextPage
+                if (textPage.height < durY) {
+                    textPage.height = durY
+                }
                 if (doublePage && absStartX < viewWidth / 2) {
                     //当前页面左列结束
                     textPage.leftLineSize = textPage.lineSize
@@ -452,9 +455,6 @@ class TextChapterLayout(
                     stringBuilder.clear()
                     absStartX = paddingLeft
                 }
-                if (textPage.height < durY) {
-                    textPage.height = durY
-                }
                 durY = 0f
             }
             val lineStart = layout.getLineStart(lineIndex)