pull/60/head
kunfei 5 years ago
parent 7b9d66dd78
commit 3002eac71c
  1. 2
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt
  2. 2
      app/src/main/java/io/legado/app/ui/widget/page/TextChapter.kt

@ -256,8 +256,10 @@ class ReadBookActivity : VMBaseActivity<ReadBookViewModel>(R.layout.activity_boo
} }
override fun upContent(position: Int) { override fun upContent(position: Int) {
launch {
page_view.upContent(position) page_view.upContent(position)
} }
}
override fun upView() { override fun upView() {
ReadBook.curTextChapter?.let { ReadBook.curTextChapter?.let {

@ -55,7 +55,7 @@ data class TextChapter(
fun getReadLength(pageIndex: Int): Int { fun getReadLength(pageIndex: Int): Int {
var length = 0 var length = 0
val maxIndex = min(pageIndex, pageLines.lastIndex) val maxIndex = min(pageIndex, pageLines.lastIndex)
for (index in 0 until maxIndex) { for (index in 0..maxIndex) {
length += pageLengths[index] length += pageLengths[index]
} }
return length return length

Loading…
Cancel
Save