diff --git a/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt b/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt index bcde1f376..a3a9639b9 100644 --- a/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt @@ -53,6 +53,7 @@ class ContentView : FrameLayout { } if (content_text_view.atBottom()) { setPageIndex(pageSize - 1) + callBack?.scrollToLast() } } } diff --git a/app/src/main/java/io/legado/app/ui/widget/page/PageView.kt b/app/src/main/java/io/legado/app/ui/widget/page/PageView.kt index 447b6b1e6..12b90dae2 100644 --- a/app/src/main/java/io/legado/app/ui/widget/page/PageView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/page/PageView.kt @@ -221,16 +221,20 @@ class PageView(context: Context, attrs: AttributeSet) : } override fun scrollToLine(line: Int) { - callback?.textChapter()?.let { - val pageIndex = it.getPageIndex(line) - curPage?.setPageIndex(pageIndex) - callback?.setPageIndex(pageIndex) + if (isScrollDelegate()) { + callback?.textChapter()?.let { + val pageIndex = it.getPageIndex(line) + curPage?.setPageIndex(pageIndex) + callback?.setPageIndex(pageIndex) + } } } override fun scrollToLast() { - callback?.textChapter()?.let { - callback?.setPageIndex(it.lastIndex()) + if (isScrollDelegate()) { + callback?.textChapter()?.let { + callback?.setPageIndex(it.lastIndex()) + } } }