feat: 优化代码

pull/133/head
kunfei 5 years ago
parent b9755a317d
commit cad97612d4
  1. 3
      app/src/main/java/io/legado/app/ui/book/read/page/delegate/CoverPageDelegate.kt

@ -34,11 +34,12 @@ class CoverPageDelegate(pageView: PageView) : HorizontalPageDelegate(pageView) {
if (!isRunning) return if (!isRunning) return
if (mDirection == Direction.PREV) { if (mDirection == Direction.PREV) {
prevPage.translationX = offsetX - viewWidth prevPage.translationX = offsetX - viewWidth
addShadow(distanceX.toInt(), canvas)
} else if (mDirection == Direction.NEXT) { } else if (mDirection == Direction.NEXT) {
curPage.translationX = offsetX curPage.translationX = offsetX
}
addShadow(distanceX.toInt(), canvas) addShadow(distanceX.toInt(), canvas)
} }
}
private fun addShadow(left: Int, canvas: Canvas) { private fun addShadow(left: Int, canvas: Canvas) {
if (left < 0) { if (left < 0) {

Loading…
Cancel
Save