Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -262,13 +262,13 @@ class RNGestureHandlerButtonViewManager :
}
}

override fun onInterceptTouchEvent(ev: MotionEvent): Boolean {
if (super.onInterceptTouchEvent(ev)) {
override fun onInterceptTouchEvent(event: MotionEvent): Boolean {
if (super.onInterceptTouchEvent(event)) {
return true
}
// We call `onTouchEvent` and wait until button changes state to `pressed`, if it's pressed
// we return true so that the gesture handler can activate.
onTouchEvent(ev)
onTouchEvent(event)
return isPressed
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ class RNGestureHandlerRootHelper(private val context: ReactContext, wrappedView:
}
}

fun dispatchTouchEvent(ev: MotionEvent): Boolean {
fun dispatchTouchEvent(event: MotionEvent): Boolean {
// We mark `mPassingTouch` before we get into `mOrchestrator.onTouchEvent` so that we can tell
// if `requestDisallow` has been called as a result of a normal gesture handling process or
// as a result of one of the gesture handlers activating
passingTouch = true
orchestrator!!.onTouchEvent(ev)
orchestrator!!.onTouchEvent(event)
passingTouch = false
return shouldIntercept
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ class RNGestureHandlerRootView(context: Context?) : ReactViewGroup(context) {
rootHelper?.tearDown()
}

override fun dispatchTouchEvent(ev: MotionEvent) = if (rootViewEnabled && rootHelper!!.dispatchTouchEvent(ev)) {
override fun dispatchTouchEvent(event: MotionEvent) = if (rootViewEnabled && rootHelper!!.dispatchTouchEvent(event)) {
true
} else {
super.dispatchTouchEvent(ev)
super.dispatchTouchEvent(event)
}

override fun dispatchGenericMotionEvent(event: MotionEvent) =
Expand Down