Skip to content

Commit 430b92e

Browse files
tomekzawm-bert
authored andcommitted
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 e93030d commit 430b92e

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
@@ -115,12 +115,12 @@ class RNGestureHandlerRootHelper(private val context: ReactContext, wrappedView:
115115
}
116116
}
117117

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

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
@@ -37,10 +37,10 @@ class RNGestureHandlerRootView(context: Context?) : ReactViewGroup(context) {
3737
rootHelper?.tearDown()
3838
}
3939

40-
override fun dispatchTouchEvent(ev: MotionEvent) = if (rootViewEnabled && rootHelper!!.dispatchTouchEvent(ev)) {
40+
override fun dispatchTouchEvent(event: MotionEvent) = if (rootViewEnabled && rootHelper!!.dispatchTouchEvent(event)) {
4141
true
4242
} else {
43-
super.dispatchTouchEvent(ev)
43+
super.dispatchTouchEvent(event)
4444
}
4545

4646
override fun dispatchGenericMotionEvent(event: MotionEvent) =

0 commit comments

Comments
 (0)