diff options
author | Allan Wang <me@allanwang.ca> | 2019-07-01 21:26:31 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2019-07-01 21:26:31 -0700 |
commit | 9f51fb4730058b91b6dc081f419dff84ce627b93 (patch) | |
tree | a14ae747530dc5fd2903a05a165148045c34c8cb | |
parent | 4b40be65fd4854c1772ae60ecf784b14e489734c (diff) | |
download | kau-9f51fb4730058b91b6dc081f419dff84ce627b93.tar.gz kau-9f51fb4730058b91b6dc081f419dff84ce627b93.tar.bz2 kau-9f51fb4730058b91b6dc081f419dff84ce627b93.zip |
Use recommended velocities by default
-rw-r--r-- | core/src/main/kotlin/ca/allanwang/kau/swipe/SwipeBackLayout.kt | 4 | ||||
-rw-r--r-- | core/src/main/kotlin/ca/allanwang/kau/swipe/ViewDragHelper.java | 4 |
2 files changed, 2 insertions, 6 deletions
diff --git a/core/src/main/kotlin/ca/allanwang/kau/swipe/SwipeBackLayout.kt b/core/src/main/kotlin/ca/allanwang/kau/swipe/SwipeBackLayout.kt index 1f564ce..d26fb92 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/swipe/SwipeBackLayout.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/swipe/SwipeBackLayout.kt @@ -162,12 +162,8 @@ internal class SwipeBackLayout @JvmOverloads constructor( init { dragHelper = ViewDragHelper.create(this, ViewDragCallback()) - val density = resources.displayMetrics.density - val minVel = MIN_FLING_VELOCITY * density //allow touch from anywhere on the screen edgeSize = Math.max(resources.displayMetrics.widthPixels, resources.displayMetrics.heightPixels) - minVelocity = minVel -// maxVelocity = 2.5f * minVel edgeFlag = edgeFlag sensitivity = 0.3f addListener(chromeFadeListener) diff --git a/core/src/main/kotlin/ca/allanwang/kau/swipe/ViewDragHelper.java b/core/src/main/kotlin/ca/allanwang/kau/swipe/ViewDragHelper.java index ac7fb7e..dab9bb8 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/swipe/ViewDragHelper.java +++ b/core/src/main/kotlin/ca/allanwang/kau/swipe/ViewDragHelper.java @@ -25,10 +25,10 @@ import static ca.allanwang.kau.swipe.SwipeBackHelperKt.SWIPE_EDGE_TOP; * of useful operations and state tracking for allowing a user to drag and reposition * views within their parent ViewGroup. * <p> - * This is an extension of {@link androidx.core.widget.ViewDragHelper} + * This is an extension of {@link androidx.customview.widget.ViewDragHelper} * Along with additional methods defined in {@link ViewDragHelperExtras} */ -class ViewDragHelper implements ViewDragHelperExtras { +public class ViewDragHelper implements ViewDragHelperExtras { private static final String TAG = "ViewDragHelper"; /** |