From dcfea7b8eea456050c52a96c8c1092dadcaa9f98 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sat, 21 Sep 2019 23:54:39 +0800 Subject: [PATCH] up --- .../ui/widget/page/delegate/CoverPageDelegate.kt | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/widget/page/delegate/CoverPageDelegate.kt b/app/src/main/java/io/legado/app/ui/widget/page/delegate/CoverPageDelegate.kt index af4f368aa..8d1d05e3d 100644 --- a/app/src/main/java/io/legado/app/ui/widget/page/delegate/CoverPageDelegate.kt +++ b/app/src/main/java/io/legado/app/ui/widget/page/delegate/CoverPageDelegate.kt @@ -42,7 +42,6 @@ class CoverPageDelegate(pageView: PageView) : PageDelegate(pageView) { override fun onScrollStop() { curPage?.x = 0.toFloat() - if (!isCancel) { pageView.fillPage(direction) } @@ -57,15 +56,11 @@ class CoverPageDelegate(pageView: PageView) : PageDelegate(pageView) { val distanceX = if (offsetX > 0) offsetX - viewWidth else offsetX + viewWidth bitmap?.let { - when (direction) { - Direction.PREV -> { - bitmapMatrix.setTranslate(distanceX, 0.toFloat()) - canvas.drawBitmap(it, bitmapMatrix, null) - } - Direction.NEXT -> { - curPage?.translationX = offsetX - } - Direction.NONE -> Unit + if (direction == Direction.PREV) { + bitmapMatrix.setTranslate(distanceX, 0.toFloat()) + canvas.drawBitmap(it, bitmapMatrix, null) + } else if (direction == Direction.NEXT) { + curPage?.translationX = offsetX } addShadow(distanceX.toInt(), canvas) }