mirror of
https://github.com/gedoor/legado.git
synced 2024-07-06 23:47:49 +08:00
优化
This commit is contained in:
parent
36e6c0c8a4
commit
5cef6f8e39
@ -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()
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user