From 5aef21c3b527e1e18b34b88bfe74b2698c083037 Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 23 Mar 2020 22:31:14 +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 --- .../app/ui/book/read/page/delegate/HorizontalPageDelegate.kt | 5 ++++- .../io/legado/app/ui/book/read/page/delegate/PageDelegate.kt | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/delegate/HorizontalPageDelegate.kt b/app/src/main/java/io/legado/app/ui/book/read/page/delegate/HorizontalPageDelegate.kt index 8fe4fb699..f8f9bec74 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/delegate/HorizontalPageDelegate.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/delegate/HorizontalPageDelegate.kt @@ -37,7 +37,10 @@ abstract class HorizontalPageDelegate(pageView: PageView) : PageDelegate(pageVie override fun onTouch(event: MotionEvent) { when (event.action) { MotionEvent.ACTION_DOWN -> { - abort() + if (abort()) { + onAnimStop() + stopScroll() + } } MotionEvent.ACTION_MOVE -> { if (isTextSelected) { 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 d83f60edb..cd455b641 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 @@ -154,10 +154,12 @@ abstract class PageDelegate(protected val pageView: PageView) : } } - fun abort() { + fun abort(): Boolean { if (!scroller.isFinished) { scroller.abortAnimation() + return true } + return false } open fun onAnimStart() {}//scroller start