From a9eadf79f828802be46010fbf6aabb0d76902a52 Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 24 Feb 2020 15:44:45 +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 --- .../java/io/legado/app/ui/book/read/ReadBookActivity.kt | 2 +- .../legado/app/ui/book/read/page/delegate/PageDelegate.kt | 4 ++-- .../app/ui/book/read/page/delegate/ScrollPageDelegate.kt | 6 ------ 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt index fec5bfa27..abe5f1925 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt @@ -458,7 +458,7 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo */ override fun upContent(relativePosition: Int, resetScrollOffset: Boolean) { launch { - page_view.upContent(relativePosition) + page_view.upContent(relativePosition, resetScrollOffset) } } 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 b6f9be6a4..275105fde 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 @@ -180,11 +180,11 @@ abstract class PageDelegate(protected val pageView: PageView) : onAnimStart() } - abstract fun onAnimStart()//scroller start + open fun onAnimStart() {}//scroller start open fun onDraw(canvas: Canvas) {}//绘制 - abstract fun onAnimStop()//scroller finish + open fun onAnimStop() {}//scroller finish open fun onScroll() {}//移动contentView, slidePage diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/delegate/ScrollPageDelegate.kt b/app/src/main/java/io/legado/app/ui/book/read/page/delegate/ScrollPageDelegate.kt index eca83b12a..68c024d96 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/delegate/ScrollPageDelegate.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/delegate/ScrollPageDelegate.kt @@ -24,12 +24,6 @@ class ScrollPageDelegate(pageView: PageView) : PageDelegate(pageView) { curPage.onScroll(touchY - lastY) } - override fun onAnimStop() { - if (!isCancel) { - pageView.fillPage(mDirection) - } - } - override fun onTouch(event: MotionEvent): Boolean { if (event.action == MotionEvent.ACTION_DOWN) { setStartPoint(event.x, event.y)