Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

Commit

Permalink
[fenix] For mozilla-mobile/fenix#25808: Update method signature for G…
Browse files Browse the repository at this point in the history
…estureDetector.SimpleOnGestureListener
  • Loading branch information
mcarare authored and mergify[bot] committed Nov 16, 2022
1 parent 43277b4 commit c647160
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,18 @@ class SwipeGestureLayout @JvmOverloads constructor(
) : FrameLayout(context, attrs, defStyleAttr) {

private val gestureListener = object : GestureDetector.SimpleOnGestureListener() {
override fun onDown(e: MotionEvent?): Boolean {
override fun onDown(e: MotionEvent): Boolean {
return true
}

override fun onScroll(
e1: MotionEvent?,
e2: MotionEvent?,
e1: MotionEvent,
e2: MotionEvent,
distanceX: Float,
distanceY: Float,
): Boolean {
val start = e1?.let { event -> PointF(event.rawX, event.rawY) } ?: return false
val next = e2?.let { event -> PointF(event.rawX, event.rawY) } ?: return false
val start = e1.let { event -> PointF(event.rawX, event.rawY) }
val next = e2.let { event -> PointF(event.rawX, event.rawY) }

if (activeListener == null && !handledInitialScroll) {
activeListener = listeners.firstOrNull { listener ->
Expand All @@ -81,8 +81,8 @@ class SwipeGestureLayout @JvmOverloads constructor(
}

override fun onFling(
e1: MotionEvent?,
e2: MotionEvent?,
e1: MotionEvent,
e2: MotionEvent,
velocityX: Float,
velocityY: Float,
): Boolean {
Expand Down

0 comments on commit c647160

Please sign in to comment.