Skip to content

Commit

Permalink
Fix SimpleOnGestureListener implementation in SkikoGesturesDetector.a…
Browse files Browse the repository at this point in the history
…ndroid.kt
  • Loading branch information
m-sasha committed Jun 19, 2023
1 parent 8a83c49 commit 288c143
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,15 @@ private val swipeThreshold = 100
private val swipeVelocityThreshold = 100

internal fun toSkikoGestureDirection(
event1: MotionEvent,
event1: MotionEvent?,
event2: MotionEvent,
velocityX: Float,
velocityY: Float
): SkikoGestureEventDirection {
if (event1 == null) {
return SkikoGestureEventDirection.UNKNOWN
}

val dx = event2.x - event1.x
val dy = event2.y - event1.y
if (abs(dx) > abs(dy)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ internal class SkikoGesturesDetector(
}

override fun onScroll(
event1: MotionEvent,
event1: MotionEvent?,
event2: MotionEvent,
distanceX: Float,
distanceY: Float,
Expand All @@ -98,7 +98,7 @@ internal class SkikoGesturesDetector(
}

override fun onFling(
event1: MotionEvent,
event1: MotionEvent?,
event2: MotionEvent,
velocityX: Float,
velocityY: Float
Expand Down

0 comments on commit 288c143

Please sign in to comment.