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) {
|
||||
val overscroll = (pos - initialMotion) * DRAG_RATE
|
||||
if (overscroll > 0) { // Keep this check
|
||||
val overscroll = abs((pos - initialMotion) * DRAG_RATE)
|
||||
parent.requestDisallowInterceptTouchEvent(true)
|
||||
if (vertical) {
|
||||
val totalDragDistance = Resources.getSystem().displayMetrics.heightPixels / dragDivider
|
||||
|
@ -176,14 +175,13 @@ class Swipy @JvmOverloads constructor(
|
|||
rightBeingSwiped.invoke(overscroll / totalDragDistance)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun resetSwipes() {
|
||||
if (vertical) {
|
||||
topBeingSwiped.invoke(0f)
|
||||
bottomBeingSwiped.invoke(0f)
|
||||
} else {
|
||||
rightBeingSwiped.invoke( 0f)
|
||||
rightBeingSwiped.invoke(0f)
|
||||
leftBeingSwiped.invoke(0f)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue