From 0dffb04e353f6bf7e4b9031391b12c8e4b3fa302 Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 23 Sep 2019 08:57:06 +0800 Subject: [PATCH] up --- .../main/java/io/legado/app/ui/widget/page/ContentView.kt | 1 + app/src/main/java/io/legado/app/ui/widget/page/PageView.kt | 6 ++++++ 2 files changed, 7 insertions(+) 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