Skip to content

Commit

Permalink
Fix nullability of MotionEvents (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
sylwester-zielinski authored and natario1 committed Jan 31, 2019
1 parent 358e32c commit a2f9fb1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/src/main/java/com/otaliastudios/zoom/ZoomEngine.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,7 @@ internal constructor(context: Context) : ViewTreeObserver.OnGlobalLayoutListener
return true // We are interested in the gesture.
}

override fun onFling(e1: MotionEvent, e2: MotionEvent, velocityX: Float, velocityY: Float): Boolean {
override fun onFling(e1: MotionEvent?, e2: MotionEvent?, velocityX: Float, velocityY: Float): Boolean {
// If disabled, don't start the gesture.
if (!mFlingEnabled) return false
if (!mHorizontalPanEnabled && !mVerticalPanEnabled) return false
Expand All @@ -1061,7 +1061,7 @@ internal constructor(context: Context) : ViewTreeObserver.OnGlobalLayoutListener
*
* TODO this this not true! ^
*/
override fun onScroll(e1: MotionEvent, e2: MotionEvent,
override fun onScroll(e1: MotionEvent?, e2: MotionEvent?,
@AbsolutePan distanceX: Float, @AbsolutePan distanceY: Float): Boolean {
if (!mHorizontalPanEnabled && !mVerticalPanEnabled) return false

Expand Down

0 comments on commit a2f9fb1

Please sign in to comment.