|
|
|
@ -15,19 +15,21 @@ class ScrollPageDelegate(pageView: PageView) : PageDelegate(pageView) { |
|
|
|
|
} |
|
|
|
|
val distanceY: Float |
|
|
|
|
when (direction) { |
|
|
|
|
Direction.NEXT -> if (isCancel) { |
|
|
|
|
Direction.NEXT -> distanceY = |
|
|
|
|
if (isCancel) { |
|
|
|
|
var dis = viewHeight - startY + touchY |
|
|
|
|
if (dis > viewHeight) { |
|
|
|
|
dis = viewHeight.toFloat() |
|
|
|
|
} |
|
|
|
|
distanceY = viewHeight - dis |
|
|
|
|
viewHeight - dis |
|
|
|
|
} else { |
|
|
|
|
distanceY = -(touchY + (viewHeight - startY)) |
|
|
|
|
-(touchY + (viewHeight - startY)) |
|
|
|
|
} |
|
|
|
|
else -> distanceY = if (isCancel) { |
|
|
|
|
else -> distanceY = |
|
|
|
|
if (isCancel) { |
|
|
|
|
-(touchY - startY) |
|
|
|
|
} else { |
|
|
|
|
viewWidth - (touchY - startY) |
|
|
|
|
viewHeight - (touchY - startY) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|