fix: Swipy (#506)
This commit is contained in:
parent
652ef219dd
commit
f191502a97
1 changed files with 15 additions and 17 deletions
|
@ -159,8 +159,7 @@ class Swipy @JvmOverloads constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun handleDrag(pos: Float) {
|
private fun handleDrag(pos: Float) {
|
||||||
val overscroll = (pos - initialMotion) * DRAG_RATE
|
val overscroll = abs((pos - initialMotion) * DRAG_RATE)
|
||||||
if (overscroll > 0) { // Keep this check
|
|
||||||
parent.requestDisallowInterceptTouchEvent(true)
|
parent.requestDisallowInterceptTouchEvent(true)
|
||||||
if (vertical) {
|
if (vertical) {
|
||||||
val totalDragDistance = Resources.getSystem().displayMetrics.heightPixels / dragDivider
|
val totalDragDistance = Resources.getSystem().displayMetrics.heightPixels / dragDivider
|
||||||
|
@ -176,7 +175,6 @@ class Swipy @JvmOverloads constructor(
|
||||||
rightBeingSwiped.invoke(overscroll / totalDragDistance)
|
rightBeingSwiped.invoke(overscroll / totalDragDistance)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private fun resetSwipes() {
|
private fun resetSwipes() {
|
||||||
if (vertical) {
|
if (vertical) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue