mirror of
https://github.com/gedoor/legado.git
synced 2024-07-06 23:47:49 +08:00
优化
This commit is contained in:
parent
62f11ef178
commit
a3254a4cdf
@ -665,7 +665,7 @@ class ReadView(context: Context, attrs: AttributeSet) :
|
||||
val line = page.lines.first()
|
||||
val durChapterPos = ReadBook.durChapterPos
|
||||
val startPos = line.chapterPosition
|
||||
val endPos = line.chapterPosition + line.charSize
|
||||
val endPos = startPos + line.charSize
|
||||
if (durChapterPos in startPos..<endPos) {
|
||||
post {
|
||||
upContent(resetPageOffset = false)
|
||||
|
@ -267,6 +267,8 @@ data class TextChapter(
|
||||
fun setProgressListener(l: LayoutProgressListener) {
|
||||
if (isCompleted) {
|
||||
l.onLayoutCompleted()
|
||||
} else if (layout?.exception != null) {
|
||||
l.onLayoutException(layout?.exception!!)
|
||||
} else {
|
||||
listener = l
|
||||
}
|
||||
|
@ -66,12 +66,12 @@ class TextChapterLayout(
|
||||
private val stringBuilder = StringBuilder()
|
||||
|
||||
private var isCompleted = false
|
||||
private var exception: Throwable? = null
|
||||
private val job: Coroutine<*>
|
||||
private val bookChapter inline get() = textChapter.chapter
|
||||
private val displayTitle inline get() = textChapter.title
|
||||
private val chaptersSize inline get() = textChapter.chaptersSize
|
||||
|
||||
var exception: Throwable? = null
|
||||
|
||||
init {
|
||||
job = Coroutine.async(scope) {
|
||||
|
Loading…
Reference in New Issue
Block a user