From 9f51fb4730058b91b6dc081f419dff84ce627b93 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Mon, 1 Jul 2019 21:26:31 -0700 Subject: Use recommended velocities by default --- core/src/main/kotlin/ca/allanwang/kau/swipe/SwipeBackLayout.kt | 4 ---- 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. *

- * 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"; /** -- cgit v1.2.3