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() {
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)
}

Loading…
Cancel
Save