pull/34/head
kunfei 5 years ago
parent 0dffb04e35
commit 4cd983f331
  1. 1
      app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt
  2. 4
      app/src/main/java/io/legado/app/ui/widget/page/PageView.kt

@ -53,6 +53,7 @@ class ContentView : FrameLayout {
}
if (content_text_view.atBottom()) {
setPageIndex(pageSize - 1)
callBack?.scrollToLast()
}
}
}

@ -221,18 +221,22 @@ class PageView(context: Context, attrs: AttributeSet) :
}
override fun scrollToLine(line: Int) {
if (isScrollDelegate()) {
callback?.textChapter()?.let {
val pageIndex = it.getPageIndex(line)
curPage?.setPageIndex(pageIndex)
callback?.setPageIndex(pageIndex)
}
}
}
override fun scrollToLast() {
if (isScrollDelegate()) {
callback?.textChapter()?.let {
callback?.setPageIndex(it.lastIndex())
}
}
}
interface CallBack {
fun chapterSize(): Int

Loading…
Cancel
Save