Unverified Commit 697d4896 authored by Alexander Maryanovsky's avatar Alexander Maryanovsky Committed by GitHub

Fix SimpleOnGestureListener implementation in SkikoGesturesDetector.android.kt (#725)

parent ab1d03de
...@@ -99,11 +99,15 @@ private val swipeThreshold = 100 ...@@ -99,11 +99,15 @@ private val swipeThreshold = 100
private val swipeVelocityThreshold = 100 private val swipeVelocityThreshold = 100
internal fun toSkikoGestureDirection( internal fun toSkikoGestureDirection(
event1: MotionEvent, event1: MotionEvent?,
event2: MotionEvent, event2: MotionEvent,
velocityX: Float, velocityX: Float,
velocityY: Float velocityY: Float
): SkikoGestureEventDirection { ): SkikoGestureEventDirection {
if (event1 == null) {
return SkikoGestureEventDirection.UNKNOWN
}
val dx = event2.x - event1.x val dx = event2.x - event1.x
val dy = event2.y - event1.y val dy = event2.y - event1.y
if (abs(dx) > abs(dy)) { if (abs(dx) > abs(dy)) {
......
...@@ -79,7 +79,7 @@ internal class SkikoGesturesDetector( ...@@ -79,7 +79,7 @@ internal class SkikoGesturesDetector(
} }
override fun onScroll( override fun onScroll(
event1: MotionEvent, event1: MotionEvent?,
event2: MotionEvent, event2: MotionEvent,
distanceX: Float, distanceX: Float,
distanceY: Float, distanceY: Float,
...@@ -98,7 +98,7 @@ internal class SkikoGesturesDetector( ...@@ -98,7 +98,7 @@ internal class SkikoGesturesDetector(
} }
override fun onFling( override fun onFling(
event1: MotionEvent, event1: MotionEvent?,
event2: MotionEvent, event2: MotionEvent,
velocityX: Float, velocityX: Float,
velocityY: Float velocityY: Float
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment