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 From d91d7348605c9e3fee65c888d61679eac7ad2aad Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Mon, 1 Jul 2019 21:30:21 -0700 Subject: Update changelog --- .idea/codeStyles/Project.xml | 9 --------- sample/src/main/res/xml/kau_changelog.xml | 3 +++ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index be6976d..3962e1c 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -1,8 +1,5 @@ - - - - -

- - - - xmlns:android - ^$ - - - -
-
- - - - xmlns:.* - ^$ - - - BY_NAME - -
-
- - - - .*:id - http://schemas.android.com/apk/res/android - - - -
-
- - - - .*:name - http://schemas.android.com/apk/res/android - - - -
-
- - - - name - ^$ - - - -
-
- - - - style - ^$ - - - -
-
- - - - .* - ^$ - - - BY_NAME - -
-
- - - - .* - http://schemas.android.com/apk/res/android - - - ANDROID_ATTRIBUTE_ORDER - -
-
- - - - .* - .* - - - BY_NAME - -
- - - - - - - \ No newline at end of file -- cgit v1.2.3