Horis 2 yıl önce
ebeveyn
işleme
509c2fdc5c

+ 1 - 1
app/src/main/java/io/legado/app/ui/book/read/page/ReadView.kt

@@ -665,7 +665,7 @@ class ReadView(context: Context, attrs: AttributeSet) :
         val line = page.lines.first()
         val line = page.lines.first()
         val durChapterPos = ReadBook.durChapterPos
         val durChapterPos = ReadBook.durChapterPos
         val startPos = line.chapterPosition
         val startPos = line.chapterPosition
-        val endPos = line.chapterPosition + line.charSize
+        val endPos = startPos + line.charSize
         if (durChapterPos in startPos..<endPos) {
         if (durChapterPos in startPos..<endPos) {
             post {
             post {
                 upContent(resetPageOffset = false)
                 upContent(resetPageOffset = false)

+ 2 - 0
app/src/main/java/io/legado/app/ui/book/read/page/entities/TextChapter.kt

@@ -267,6 +267,8 @@ data class TextChapter(
     fun setProgressListener(l: LayoutProgressListener) {
     fun setProgressListener(l: LayoutProgressListener) {
         if (isCompleted) {
         if (isCompleted) {
             l.onLayoutCompleted()
             l.onLayoutCompleted()
+        } else if (layout?.exception != null) {
+            l.onLayoutException(layout?.exception!!)
         } else {
         } else {
             listener = l
             listener = l
         }
         }

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

@@ -66,12 +66,12 @@ class TextChapterLayout(
     private val stringBuilder = StringBuilder()
     private val stringBuilder = StringBuilder()
 
 
     private var isCompleted = false
     private var isCompleted = false
-    private var exception: Throwable? = null
     private val job: Coroutine<*>
     private val job: Coroutine<*>
     private val bookChapter inline get() = textChapter.chapter
     private val bookChapter inline get() = textChapter.chapter
     private val displayTitle inline get() = textChapter.title
     private val displayTitle inline get() = textChapter.title
     private val chaptersSize inline get() = textChapter.chaptersSize
     private val chaptersSize inline get() = textChapter.chaptersSize
 
 
+    var exception: Throwable? = null
 
 
     init {
     init {
         job = Coroutine.async(scope) {
         job = Coroutine.async(scope) {