From 3aa9b034d5b90526ca0423d04bf1d992c1f3f0cc Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 24 Feb 2020 15:04:46 +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/page/ContentTextView.kt | 6 ++---- .../java/io/legado/app/ui/book/read/page/ContentView.kt | 3 ++- .../legado/app/ui/book/read/page/delegate/PageDelegate.kt | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt index fb7ad11c5..eafa79676 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt @@ -4,7 +4,6 @@ import android.content.Context import android.graphics.Canvas import android.graphics.Paint import android.util.AttributeSet -import android.util.Log import android.view.View import io.legado.app.R import io.legado.app.constant.PreferKey @@ -159,14 +158,13 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at if (pageOffset > 0) { pageFactory.moveToPrev() textPage = pageFactory.currentPage ?: TextPage().format() - Log.e("pageOffSet", pageOffset.toString() + " " + textPage.height) pageOffset -= textPage.height - callBack.upContent(0, false) +// callBack.upContent(0, false) } else if (pageOffset < -textPage.height) { pageOffset += textPage.height pageFactory.moveToNext() textPage = pageFactory.currentPage ?: TextPage().format() - callBack.upContent(0, false) +// callBack.upContent(0, false) } invalidate() } 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 3140e6d1a..45fa4c1d7 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 @@ -99,8 +99,9 @@ class ContentView(context: Context) : FrameLayout(context) { if (resetScrollOffset) { content_text_view.resetPageOffset() content_text_view.setContent(textPage) + } else { + content_text_view.invalidate() } - content_text_view.invalidate() } } 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 fec677deb..b6f9be6a4 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 @@ -140,7 +140,7 @@ abstract class PageDelegate(protected val pageView: PageView) : if (scroller.computeScrollOffset()) { setTouchPoint(scroller.currX.toFloat(), scroller.currY.toFloat()) } else if (isStarted) { - setTouchPoint(scroller.finalX.toFloat(), scroller.finalY.toFloat(), false) + setTouchPoint(scroller.currY.toFloat(), scroller.finalY.toFloat(), false) onAnimStop() stopScroll() }