@@ -57,19 +57,10 @@ class RNGestureHandlerEventDispatcher(private val reactApplicationContext: React
57
57
}
58
58
GestureHandler .ACTION_TYPE_JS_FUNCTION_OLD_API -> {
59
59
// JS function, Animated.event with useNativeDriver: false using old API
60
- if (BuildConfig .IS_NEW_ARCHITECTURE_ENABLED ) {
61
- val data = RNGestureHandlerEvent .createEventData(
62
- handlerFactory.createEventBuilder(handler),
63
- )
64
- sendEventForDeviceEvent(RNGestureHandlerEvent .EVENT_NAME , data)
65
- } else {
66
- val event = RNGestureHandlerEvent .obtain(
67
- handler,
68
- handler.actionType,
69
- handlerFactory.createEventBuilder(handler),
70
- )
71
- sendEventForDirectEvent(event)
72
- }
60
+ val data = RNGestureHandlerEvent .createEventData(
61
+ handlerFactory.createEventBuilder(handler),
62
+ )
63
+ sendEventForDeviceEvent(RNGestureHandlerEvent .EVENT_NAME , data)
73
64
}
74
65
GestureHandler .ACTION_TYPE_JS_FUNCTION_NEW_API -> {
75
66
// JS function, Animated.event with useNativeDriver: false using new API
@@ -135,23 +126,12 @@ class RNGestureHandlerEventDispatcher(private val reactApplicationContext: React
135
126
136
127
GestureHandler .ACTION_TYPE_NATIVE_ANIMATED_EVENT , GestureHandler .ACTION_TYPE_JS_FUNCTION_OLD_API -> {
137
128
// JS function or Animated.event with useNativeDriver: false with old API
138
- if (BuildConfig .IS_NEW_ARCHITECTURE_ENABLED ) {
139
- val data = RNGestureHandlerStateChangeEvent .createEventData(
140
- handlerFactory.createEventBuilder(handler),
141
- newState,
142
- oldState,
143
- )
144
- sendEventForDeviceEvent(RNGestureHandlerStateChangeEvent .EVENT_NAME , data)
145
- } else {
146
- val event = RNGestureHandlerStateChangeEvent .obtain(
147
- handler,
148
- newState,
149
- oldState,
150
- handler.actionType,
151
- handlerFactory.createEventBuilder(handler),
152
- )
153
- sendEventForDirectEvent(event)
154
- }
129
+ val data = RNGestureHandlerStateChangeEvent .createEventData(
130
+ handlerFactory.createEventBuilder(handler),
131
+ newState,
132
+ oldState,
133
+ )
134
+ sendEventForDeviceEvent(RNGestureHandlerStateChangeEvent .EVENT_NAME , data)
155
135
}
156
136
157
137
GestureHandler .ACTION_TYPE_JS_FUNCTION_NEW_API -> {
@@ -219,13 +199,7 @@ class RNGestureHandlerEventDispatcher(private val reactApplicationContext: React
219
199
220
200
private fun <T : Event <T >> sendEventForReanimated (event : T ) {
221
201
// Delivers the event to Reanimated.
222
- if (BuildConfig .IS_NEW_ARCHITECTURE_ENABLED ) {
223
- // Send event directly to Reanimated
224
- reanimatedProxy.sendEvent(event, reactApplicationContext)
225
- } else {
226
- // In the old architecture, Reanimated subscribes for specific direct events.
227
- sendEventForDirectEvent(event)
228
- }
202
+ reanimatedEventDispatcher.sendEvent(event, reactApplicationContext)
229
203
}
230
204
231
205
private fun sendEventForNativeAnimatedEvent (event : RNGestureHandlerEvent ) {
0 commit comments