From d400a67f534145652fa660e49e3220fbf31dff0f Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 25 Feb 2020 09:44:15 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/ui/book/read/page/ContentView.kt | 4 ++++ .../io/legado/app/ui/book/read/page/delegate/PageDelegate.kt | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt index 512f778a7..2f77ac986 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt @@ -105,6 +105,10 @@ class ContentView(context: Context) : FrameLayout(context) { } } + fun resetPageOffset() { + content_text_view.resetPageOffset() + } + @SuppressLint("SetTextI18n") fun setPageIndex(pageIndex: Int?) { pageIndex?.let { diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/delegate/PageDelegate.kt b/app/src/main/java/io/legado/app/ui/book/read/page/delegate/PageDelegate.kt index 234ce8097..7c453d9c7 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/delegate/PageDelegate.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/delegate/PageDelegate.kt @@ -70,6 +70,10 @@ abstract class PageDelegate(protected val pageView: PageView) : var firstLineIndex: Int = 0 var firstCharIndex: Int = 0 + init { + curPage.resetPageOffset() + } + open fun setStartPoint(x: Float, y: Float, invalidate: Boolean = true) { startX = x startY = y