diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/delegate/CoverPageDelegate.kt b/app/src/main/java/io/legado/app/ui/book/read/page/delegate/CoverPageDelegate.kt index f8122fde3..21ffcee77 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/delegate/CoverPageDelegate.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/delegate/CoverPageDelegate.kt @@ -18,7 +18,7 @@ class CoverPageDelegate(pageView: PageView) : HorizontalPageDelegate(pageView) { shadowDrawableR.gradientType = GradientDrawable.LINEAR_GRADIENT } - override fun onScrollStart() { + override fun onAnimStart() { val distanceX: Float when (mDirection) { Direction.NEXT -> distanceX = @@ -42,7 +42,7 @@ class CoverPageDelegate(pageView: PageView) : HorizontalPageDelegate(pageView) { startScroll(touchX.toInt(), 0, distanceX.toInt(), 0) } - override fun onScrollStop() { + override fun onAnimStop() { curPage.x = 0.toFloat() if (!isCancel) { pageView.fillPage(mDirection) diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/delegate/NoAnimPageDelegate.kt b/app/src/main/java/io/legado/app/ui/book/read/page/delegate/NoAnimPageDelegate.kt index 10b773df9..52dc2aeeb 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/delegate/NoAnimPageDelegate.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/delegate/NoAnimPageDelegate.kt @@ -4,14 +4,14 @@ import android.graphics.Canvas import io.legado.app.ui.book.read.page.PageView class NoAnimPageDelegate(pageView: PageView) : HorizontalPageDelegate(pageView) { - override fun onScrollStart() { + override fun onAnimStart() { startScroll(touchX.toInt(), 0, 0, 0) } override fun onDraw(canvas: Canvas) { } - override fun onScrollStop() { + override fun onAnimStop() { if (!isCancel) { pageView.fillPage(mDirection) } 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 89c186679..ac0bb9aff 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) { setTouchPoint(scroller.currX.toFloat(), scroller.currY.toFloat()) } else if (isStarted) { setTouchPoint(scroller.finalX.toFloat(), scroller.finalY.toFloat(), false) - onScrollStop() + onAnimStop() stopScroll() } } @@ -176,14 +176,14 @@ abstract class PageDelegate(protected val pageView: PageView) { return } } - onScrollStart() + onAnimStart() } - abstract fun onScrollStart()//scroller start + abstract fun onAnimStart()//scroller start abstract fun onDraw(canvas: Canvas)//绘制 - abstract fun onScrollStop()//scroller finish + abstract fun onAnimStop()//scroller finish open fun onScroll() {//移动contentView, slidePage } @@ -268,7 +268,7 @@ abstract class PageDelegate(protected val pageView: PageView) { setBitmap() } setTouchPoint(x, y) - onScrollStart() + onAnimStart() } return true } @@ -288,7 +288,7 @@ abstract class PageDelegate(protected val pageView: PageView) { velocityX: Float, velocityY: Float ): Boolean { - if (!noNext) onScrollStart() + if (!noNext) onAnimStart() return true } } 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 7565e6223..9c9aade48 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 @@ -10,7 +10,7 @@ class ScrollPageDelegate(pageView: PageView) : PageDelegate(pageView) { private val bitmapMatrix = Matrix() - override fun onScrollStart() { + override fun onAnimStart() { if (!atTop && !atBottom) { stopScroll() return @@ -61,7 +61,7 @@ class ScrollPageDelegate(pageView: PageView) : PageDelegate(pageView) { } } - override fun onScrollStop() { + override fun onAnimStop() { if (!isCancel) { pageView.fillPage(mDirection) } diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/delegate/SimulationPageDelegate.kt b/app/src/main/java/io/legado/app/ui/book/read/page/delegate/SimulationPageDelegate.kt index 1d0e1ec19..789fb61e1 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/delegate/SimulationPageDelegate.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/delegate/SimulationPageDelegate.kt @@ -168,7 +168,7 @@ class SimulationPageDelegate(pageView: PageView) : HorizontalPageDelegate(pageVi } } - override fun onScrollStart() { + override fun onAnimStart() { var dx: Float val dy: Float // dx 水平方向滑动的距离,负值会使滚动向左滚动 @@ -202,7 +202,7 @@ class SimulationPageDelegate(pageView: PageView) : HorizontalPageDelegate(pageVi startScroll(touchX.toInt(), touchY.toInt(), dx.toInt(), dy.toInt()) } - override fun onScrollStop() { + override fun onAnimStop() { if (!isCancel) { pageView.fillPage(mDirection) } diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/delegate/SlidePageDelegate.kt b/app/src/main/java/io/legado/app/ui/book/read/page/delegate/SlidePageDelegate.kt index 7704b6880..0308d965e 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/delegate/SlidePageDelegate.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/delegate/SlidePageDelegate.kt @@ -8,7 +8,7 @@ class SlidePageDelegate(pageView: PageView) : HorizontalPageDelegate(pageView) { private val bitmapMatrix = Matrix() - override fun onScrollStart() { + override fun onAnimStart() { val distanceX: Float when (mDirection) { Direction.NEXT -> distanceX = @@ -56,7 +56,7 @@ class SlidePageDelegate(pageView: PageView) : HorizontalPageDelegate(pageView) { curPage.translationX = offsetX } - override fun onScrollStop() { + override fun onAnimStop() { curPage.x = 0.toFloat() if (!isCancel) {