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 8e9d2dc
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/react/events/RNGestureHandlerEventDispatcher.kt
+22-2Lines changed: 22 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -79,7 +79,6 @@ class RNGestureHandlerEventDispatcher(private val reactApplicationContext: React
79
79
} else {
80
80
EventHandlerType.ForJS
81
81
}
82
-
83
82
val event =RNGestureHandlerEvent.obtain(
84
83
handler,
85
84
handler.actionType,
@@ -90,10 +89,18 @@ class RNGestureHandlerEventDispatcher(private val reactApplicationContext: React
90
89
handler.viewForEvents!!.dispatchEvent(event)
91
90
}
92
91
GestureHandler.ACTION_TYPE_LOGIC_DETECTOR-> {
92
+
val eventHandlerType =if (handler.dispatchesAnimatedEvents) {
93
+
EventHandlerType.ForAnimated
94
+
} elseif (handler.dispatchesReanimatedEvents) {
95
+
EventHandlerType.ForReanimated
96
+
} else {
97
+
EventHandlerType.ForJS
98
+
}
93
99
val event =RNGestureHandlerEvent.obtain(
94
100
handler,
95
101
handler.actionType,
96
102
handlerFactory.createEventBuilder(handler),
103
+
eventHandlerType,
97
104
)
98
105
99
106
handler.parentView?.dispatchEvent(event)
@@ -165,12 +172,19 @@ class RNGestureHandlerEventDispatcher(private val reactApplicationContext: React
165
172
}
166
173
167
174
GestureHandler.ACTION_TYPE_LOGIC_DETECTOR-> {
175
+
val eventHandlerType =if (handler.dispatchesReanimatedEvents) {
176
+
EventHandlerType.ForReanimated
177
+
} else {
178
+
EventHandlerType.ForJS
179
+
}
180
+
168
181
val event =RNGestureHandlerStateChangeEvent.obtain(
169
182
handler,
170
183
newState,
171
184
oldState,
172
185
handler.actionType,
173
186
handlerFactory.createEventBuilder(handler),
187
+
eventHandlerType,
174
188
)
175
189
handler.parentView?.dispatchEvent(event)
176
190
}
@@ -219,7 +233,13 @@ class RNGestureHandlerEventDispatcher(private val reactApplicationContext: React
219
233
handler.viewForEvents!!.dispatchEvent(event)
220
234
}
221
235
GestureHandler.ACTION_TYPE_LOGIC_DETECTOR-> {
222
-
val event =RNGestureHandlerTouchEvent.obtain(handler, handler.actionType)
236
+
val eventHandlerType =if (handler.dispatchesReanimatedEvents) {
237
+
EventHandlerType.ForReanimated
238
+
} else {
239
+
EventHandlerType.ForJS
240
+
}
241
+
242
+
val event =RNGestureHandlerTouchEvent.obtain(handler, handler.actionType, eventHandlerType)
0 commit comments