aboutsummaryrefslogtreecommitdiff
path: root/core/src/main
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-07-01 21:26:31 -0700
committerAllan Wang <me@allanwang.ca>2019-07-01 21:26:31 -0700
commit9f51fb4730058b91b6dc081f419dff84ce627b93 (patch)
treea14ae747530dc5fd2903a05a165148045c34c8cb /core/src/main
parent4b40be65fd4854c1772ae60ecf784b14e489734c (diff)
downloadkau-9f51fb4730058b91b6dc081f419dff84ce627b93.tar.gz
kau-9f51fb4730058b91b6dc081f419dff84ce627b93.tar.bz2
kau-9f51fb4730058b91b6dc081f419dff84ce627b93.zip
Use recommended velocities by default
Diffstat (limited to 'core/src/main')
-rw-r--r--core/src/main/kotlin/ca/allanwang/kau/swipe/SwipeBackLayout.kt4
-rw-r--r--core/src/main/kotlin/ca/allanwang/kau/swipe/ViewDragHelper.java4
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";
/**