You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 215968f
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandler.kt
+19-2Lines changed: 19 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -31,13 +31,26 @@ open class GestureHandler {
31
31
var tag =0
32
32
var view:View?=null
33
33
private set
34
+
35
+
// Host detector view is a reference to a Native Detector designated to handle events from a
36
+
// Logic Detector to which the gesture is assigned.
37
+
var hostDetectorView:RNGestureHandlerDetectorView?=null
38
+
34
39
val viewForEvents:RNGestureHandlerDetectorView
35
40
get() {
36
-
assert(actionType==ACTION_TYPE_NATIVE_DETECTOR) {
41
+
assert(usesNativeOrLogicDetector(actionType)) {
37
42
"[react-native-gesture-handler] `viewForEvents` can only be used with NativeDetector."
38
43
}
39
44
40
-
val detector =if (thisisNativeViewGestureHandler) this.view?.parent else view
Copy file name to clipboardExpand all lines: packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerDetectorView.kt
+66-24Lines changed: 66 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -15,8 +15,11 @@ class RNGestureHandlerDetectorView(context: Context) : ReactViewGroup(context) {
Copy file name to clipboardExpand all lines: packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerDetectorViewManager.kt
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,10 @@ class RNGestureHandlerDetectorViewManager :
Copy file name to clipboardExpand all lines: packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/events/RNGestureHandlerEvent.kt
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -26,8 +26,8 @@ class RNGestureHandlerEvent private constructor() : Event<RNGestureHandlerEvent>
26
26
dataBuilder:GestureHandlerEventDataBuilder<T>,
27
27
eventHandlerType:EventHandlerType,
28
28
) {
29
-
val view =if (handler.actionType==GestureHandler.ACTION_TYPE_NATIVE_DETECTOR) {
30
-
handler.viewForEvents!!
29
+
val view =if (GestureHandler.usesNativeOrLogicDetector(handler.actionType)) {
30
+
handler.viewForEvents
31
31
} else {
32
32
handler.view!!
33
33
}
@@ -45,7 +45,7 @@ class RNGestureHandlerEvent private constructor() : Event<RNGestureHandlerEvent>
Copy file name to clipboardExpand all lines: packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/events/RNGestureHandlerEventDispatcher.kt
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -71,7 +71,7 @@ class RNGestureHandlerEventDispatcher(private val reactApplicationContext: React
Copy file name to clipboardExpand all lines: packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/events/RNGestureHandlerStateChangeEvent.kt
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -29,8 +29,8 @@ class RNGestureHandlerStateChangeEvent private constructor() : Event<RNGestureHa
29
29
dataBuilder:GestureHandlerEventDataBuilder<T>,
30
30
eventHandlerType:EventHandlerType,
31
31
) {
32
-
val view =if (handler.actionType==GestureHandler.ACTION_TYPE_NATIVE_DETECTOR) {
33
-
handler.viewForEvents!!
32
+
val view =if (GestureHandler.usesNativeOrLogicDetector(handler.actionType)) {
33
+
handler.viewForEvents
34
34
} else {
35
35
handler.view!!
36
36
}
@@ -51,7 +51,7 @@ class RNGestureHandlerStateChangeEvent private constructor() : Event<RNGestureHa
Copy file name to clipboardExpand all lines: packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/events/RNGestureHandlerTouchEvent.kt
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -14,8 +14,8 @@ class RNGestureHandlerTouchEvent private constructor() : Event<RNGestureHandlerT
0 commit comments