feat: 优化代码

pull/133/head
kunfei 5 years ago
parent 320c30da56
commit cfd368f5c1
  1. 4
      app/src/main/java/io/legado/app/ui/book/read/page/delegate/SimulationPageDelegate.kt

@ -136,13 +136,13 @@ 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, false) super.setTouchPoint(x, y, false)
//触摸y中间位置吧y变成屏幕高度 //触摸y中间位置吧y变成屏幕高度
if ((startY > viewHeight * 0.33 && startY < viewHeight * 0.66) if ((startY > viewHeight / 3.0 && startY < viewHeight * 2 / 3.0)
|| mDirection == Direction.PREV || mDirection == Direction.PREV
) { ) {
touchY = viewHeight.toFloat() touchY = viewHeight.toFloat()
} }
if (startY > viewHeight * 0.33 && startY < viewHeight / 2.0 if (startY > viewHeight / 3.0 && startY < viewHeight / 2.0
&& mDirection == Direction.NEXT && mDirection == Direction.NEXT
) { ) {
touchY = 1f touchY = 1f

Loading…
Cancel
Save