diff options
author | Allan Wang <me@allanwang.ca> | 2017-07-05 17:05:19 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2017-07-05 17:05:19 -0700 |
commit | 9bc520fc9041fed26ef965ef2420a0552ccc20d6 (patch) | |
tree | 945fce5215ade509b0a573f9c64c1dbbf0f6d368 /core/src/main/kotlin/ca/allanwang/kau/swipe/RelativeSlider.kt | |
parent | 36471abc904ff4aa3109bd06efbc3ed493f082b2 (diff) | |
download | kau-9bc520fc9041fed26ef965ef2420a0552ccc20d6.tar.gz kau-9bc520fc9041fed26ef965ef2420a0552ccc20d6.tar.bz2 kau-9bc520fc9041fed26ef965ef2420a0552ccc20d6.zip |
More on swipe back
Diffstat (limited to 'core/src/main/kotlin/ca/allanwang/kau/swipe/RelativeSlider.kt')
-rw-r--r-- | core/src/main/kotlin/ca/allanwang/kau/swipe/RelativeSlider.kt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/src/main/kotlin/ca/allanwang/kau/swipe/RelativeSlider.kt b/core/src/main/kotlin/ca/allanwang/kau/swipe/RelativeSlider.kt index 5d54134..2bbe9b0 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/swipe/RelativeSlider.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/swipe/RelativeSlider.kt @@ -29,10 +29,10 @@ class RelativeSlider(var curPage: SwipeBackPage) : SwipeListener { return } when (edgeFlag) { - SwipeBackLayout.EDGE_LEFT -> page.swipeBackLayout.x = Math.min(-offset * Math.max(1 - percent, 0f) + DEFAULT_OFFSET, 0f) - SwipeBackLayout.EDGE_RIGHT -> page.swipeBackLayout.x = Math.min(offset * Math.max(1 - percent, 0f) - DEFAULT_OFFSET, 0f) - SwipeBackLayout.EDGE_TOP -> page.swipeBackLayout.y = Math.min(-offset * Math.max(1 - percent, 0f) + DEFAULT_OFFSET, 0f) - SwipeBackLayout.EDGE_BOTTOM -> page.swipeBackLayout.y = Math.min(offset * Math.max(1 - percent, 0f) - DEFAULT_OFFSET, 0f) + SWIPE_EDGE_LEFT -> page.swipeBackLayout.x = Math.min(-offset * Math.max(1 - percent, 0f) + DEFAULT_OFFSET, 0f) + SWIPE_EDGE_RIGHT -> page.swipeBackLayout.x = Math.min(offset * Math.max(1 - percent, 0f) - DEFAULT_OFFSET, 0f) + SWIPE_EDGE_TOP -> page.swipeBackLayout.y = Math.min(-offset * Math.max(1 - percent, 0f) + DEFAULT_OFFSET, 0f) + SWIPE_EDGE_BOTTOM -> page.swipeBackLayout.y = Math.min(offset * Math.max(1 - percent, 0f) - DEFAULT_OFFSET, 0f) } } |