mirror of
https://github.com/gedoor/legado.git
synced 2024-07-17 00:58:29 +08:00
优化
This commit is contained in:
parent
13891e8037
commit
7a7a332d35
@ -529,8 +529,7 @@ object ReadBook : CoroutineScope by MainScope() {
|
|||||||
.getContent(book, chapter, content, includeTitle = false)
|
.getContent(book, chapter, content, includeTitle = false)
|
||||||
val textChapter =
|
val textChapter =
|
||||||
ChapterProvider.getTextChapterAsync(chapter, displayTitle, contents, chapterSize)
|
ChapterProvider.getTextChapterAsync(chapter, displayTitle, contents, chapterSize)
|
||||||
val offset = chapter.index - durChapterIndex
|
when (val offset = chapter.index - durChapterIndex) {
|
||||||
when (offset) {
|
|
||||||
0 -> {
|
0 -> {
|
||||||
curTextChapter?.cancelLayout()
|
curTextChapter?.cancelLayout()
|
||||||
curTextChapter = textChapter
|
curTextChapter = textChapter
|
||||||
@ -551,8 +550,7 @@ object ReadBook : CoroutineScope by MainScope() {
|
|||||||
available = true
|
available = true
|
||||||
}
|
}
|
||||||
if (upContent && isScroll) {
|
if (upContent && isScroll) {
|
||||||
val pageIndex = durPageIndex
|
if (max(index - 3, 0) < durPageIndex) {
|
||||||
if (max(index - 3, 0) < pageIndex) {
|
|
||||||
callBack?.upContent(offset, resetPageOffset)
|
callBack?.upContent(offset, resetPageOffset)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user