feat: 优化代码

pull/117/head
kunfei 5 years ago
parent 0cdea9b7d9
commit 183d5d7832
  1. 5
      app/src/main/java/io/legado/app/ui/book/read/page/delegate/SimulationPageDelegate.kt

@ -126,7 +126,7 @@ class SimulationPageDelegate(pageView: PageView) : HorizontalPageDelegate(pageVi
} }
override fun setTouchPoint(x: Float, y: Float, invalidate: Boolean) { override fun setTouchPoint(x: Float, y: Float, invalidate: Boolean) {
super.setTouchPoint(x, y, invalidate) super.setTouchPoint(x, y, false)
//触摸y中间位置吧y变成屏幕高度 //触摸y中间位置吧y变成屏幕高度
if ((startY > viewHeight * 0.33 && startY < viewHeight * 0.66) if ((startY > viewHeight * 0.33 && startY < viewHeight * 0.66)
|| mDirection == Direction.PREV || mDirection == Direction.PREV
@ -139,6 +139,7 @@ class SimulationPageDelegate(pageView: PageView) : HorizontalPageDelegate(pageVi
) { ) {
touchY = 1f touchY = 1f
} }
pageView.invalidate()
} }
override fun setDirection(direction: Direction) { override fun setDirection(direction: Direction) {
@ -234,7 +235,7 @@ class SimulationPageDelegate(pageView: PageView) : HorizontalPageDelegate(pageVi
drawCurrentPageShadow(canvas) drawCurrentPageShadow(canvas)
drawCurrentBackArea(canvas, prevBitmap) drawCurrentBackArea(canvas, prevBitmap)
} }
else -> Unit else -> return
} }
} }

Loading…
Cancel
Save