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 118bcfa97..bcde1f376 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 @@ -145,5 +145,6 @@ class ContentView : FrameLayout { interface CallBack { fun scrollToLine(line: Int) + fun scrollToLast() } } \ No newline at end of file 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 5a1a9e78b..447b6b1e6 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 @@ -228,6 +228,12 @@ class PageView(context: Context, attrs: AttributeSet) : } } + override fun scrollToLast() { + callback?.textChapter()?.let { + callback?.setPageIndex(it.lastIndex()) + } + } + interface CallBack { fun chapterSize(): Int fun durChapterIndex(): Int