pull/34/head
kunfei 5 years ago
parent 44a0a4467a
commit dcfea7b8ee
  1. 15
      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() { override fun onScrollStop() {
curPage?.x = 0.toFloat() curPage?.x = 0.toFloat()
if (!isCancel) { if (!isCancel) {
pageView.fillPage(direction) pageView.fillPage(direction)
} }
@ -57,15 +56,11 @@ class CoverPageDelegate(pageView: PageView) : PageDelegate(pageView) {
val distanceX = if (offsetX > 0) offsetX - viewWidth else offsetX + viewWidth val distanceX = if (offsetX > 0) offsetX - viewWidth else offsetX + viewWidth
bitmap?.let { bitmap?.let {
when (direction) { if (direction == Direction.PREV) {
Direction.PREV -> { bitmapMatrix.setTranslate(distanceX, 0.toFloat())
bitmapMatrix.setTranslate(distanceX, 0.toFloat()) canvas.drawBitmap(it, bitmapMatrix, null)
canvas.drawBitmap(it, bitmapMatrix, null) } else if (direction == Direction.NEXT) {
} curPage?.translationX = offsetX
Direction.NEXT -> {
curPage?.translationX = offsetX
}
Direction.NONE -> Unit
} }
addShadow(distanceX.toInt(), canvas) addShadow(distanceX.toInt(), canvas)
} }

Loading…
Cancel
Save