Skip to content

Commit 847b138

Browse files
committed
remove paper build cfg usages
1 parent 172a96c commit 847b138

File tree

2 files changed

+11
-41
lines changed

2 files changed

+11
-41
lines changed

packages/react-native-gesture-handler/android/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,6 @@ android {
137137
defaultConfig {
138138
minSdkVersion safeExtGet('minSdkVersion', 24)
139139
targetSdkVersion safeExtGet('targetSdkVersion', 33)
140-
141-
// TODO: Determine if IS_NEW_ARCHITECTURE_ENABLED has to be set
142-
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", "true"
143-
144140
buildConfigField "int", "REACT_NATIVE_MINOR_VERSION", REACT_NATIVE_MINOR_VERSION.toString()
145141

146142
var appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }

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

Lines changed: 11 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,10 @@ class RNGestureHandlerEventDispatcher(private val reactApplicationContext: React
5757
}
5858
GestureHandler.ACTION_TYPE_JS_FUNCTION_OLD_API -> {
5959
// 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)
7364
}
7465
GestureHandler.ACTION_TYPE_JS_FUNCTION_NEW_API -> {
7566
// JS function, Animated.event with useNativeDriver: false using new API
@@ -135,23 +126,12 @@ class RNGestureHandlerEventDispatcher(private val reactApplicationContext: React
135126

136127
GestureHandler.ACTION_TYPE_NATIVE_ANIMATED_EVENT, GestureHandler.ACTION_TYPE_JS_FUNCTION_OLD_API -> {
137128
// 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)
155135
}
156136

157137
GestureHandler.ACTION_TYPE_JS_FUNCTION_NEW_API -> {
@@ -219,13 +199,7 @@ class RNGestureHandlerEventDispatcher(private val reactApplicationContext: React
219199

220200
private fun <T : Event<T>> sendEventForReanimated(event: T) {
221201
// 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)
229203
}
230204

231205
private fun sendEventForNativeAnimatedEvent(event: RNGestureHandlerEvent) {

0 commit comments

Comments
 (0)