Skip to content

Commit f497755

Browse files
authored
Rename argument ev to event (#3695)
## Description This PR removes the following warning when building the app in release mode for Android: ``` > Task :react-native-gesture-handler:compileReleaseKotlin w: file:///Users/tomekzaw/(...)/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.kt:41:43 The corresponding parameter in the supertype 'ReactViewGroup' is named 'ev'. This may cause problems when calling this function with named arguments. ``` ## Test plan <!-- Describe how did you test this change here. -->
1 parent 2051efa commit f497755

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,13 +262,13 @@ class RNGestureHandlerButtonViewManager :
262262
}
263263
}
264264

265-
override fun onInterceptTouchEvent(ev: MotionEvent): Boolean {
266-
if (super.onInterceptTouchEvent(ev)) {
265+
override fun onInterceptTouchEvent(event: MotionEvent): Boolean {
266+
if (super.onInterceptTouchEvent(event)) {
267267
return true
268268
}
269269
// We call `onTouchEvent` and wait until button changes state to `pressed`, if it's pressed
270270
// we return true so that the gesture handler can activate.
271-
onTouchEvent(ev)
271+
onTouchEvent(event)
272272
return isPressed
273273
}
274274

packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ class RNGestureHandlerRootHelper(private val context: ReactContext, wrappedView:
110110
}
111111
}
112112

113-
fun dispatchTouchEvent(ev: MotionEvent): Boolean {
113+
fun dispatchTouchEvent(event: MotionEvent): Boolean {
114114
// We mark `mPassingTouch` before we get into `mOrchestrator.onTouchEvent` so that we can tell
115115
// if `requestDisallow` has been called as a result of a normal gesture handling process or
116116
// as a result of one of the gesture handlers activating
117117
passingTouch = true
118-
orchestrator!!.onTouchEvent(ev)
118+
orchestrator!!.onTouchEvent(event)
119119
passingTouch = false
120120
return shouldIntercept
121121
}

packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ class RNGestureHandlerRootView(context: Context?) : ReactViewGroup(context) {
3232
rootHelper?.tearDown()
3333
}
3434

35-
override fun dispatchTouchEvent(ev: MotionEvent) = if (rootViewEnabled && rootHelper!!.dispatchTouchEvent(ev)) {
35+
override fun dispatchTouchEvent(event: MotionEvent) = if (rootViewEnabled && rootHelper!!.dispatchTouchEvent(event)) {
3636
true
3737
} else {
38-
super.dispatchTouchEvent(ev)
38+
super.dispatchTouchEvent(event)
3939
}
4040

4141
override fun dispatchGenericMotionEvent(event: MotionEvent) =

0 commit comments

Comments
 (0)