fix: Swipy (#506)

This commit is contained in:
Dawn-used-yeet 2024-10-29 13:04:34 +05:30 committed by GitHub
parent 652ef219dd
commit f191502a97
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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) {