Skip to content

Commit 73968c8

Browse files
committed
remove paper build cfg usages
1 parent 41bf003 commit 73968c8

File tree

2 files changed

+11
-39
lines changed

2 files changed

+11
-39
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 & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,10 @@ class RNGestureHandlerEventDispatcher(private val reactApplicationContext: React
5555
}
5656
GestureHandler.ACTION_TYPE_JS_FUNCTION_OLD_API -> {
5757
// JS function, Animated.event with useNativeDriver: false using old API
58-
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
59-
val data = RNGestureHandlerEvent.createEventData(
60-
handlerFactory.createEventBuilder(handler),
61-
)
62-
sendEventForDeviceEvent(RNGestureHandlerEvent.EVENT_NAME, data)
63-
} else {
64-
val event = RNGestureHandlerEvent.obtain(
65-
handler,
66-
handlerFactory.createEventBuilder(handler),
67-
)
68-
sendEventForDirectEvent(event)
69-
}
58+
val data = RNGestureHandlerEvent.createEventData(
59+
handlerFactory.createEventBuilder(handler),
60+
)
61+
sendEventForDeviceEvent(RNGestureHandlerEvent.EVENT_NAME, data)
7062
}
7163
GestureHandler.ACTION_TYPE_JS_FUNCTION_NEW_API -> {
7264
// JS function, Animated.event with useNativeDriver: false using new API
@@ -99,22 +91,12 @@ class RNGestureHandlerEventDispatcher(private val reactApplicationContext: React
9991
}
10092
GestureHandler.ACTION_TYPE_NATIVE_ANIMATED_EVENT, GestureHandler.ACTION_TYPE_JS_FUNCTION_OLD_API -> {
10193
// JS function or Animated.event with useNativeDriver: false with old API
102-
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
103-
val data = RNGestureHandlerStateChangeEvent.createEventData(
104-
handlerFactory.createEventBuilder(handler),
105-
newState,
106-
oldState,
107-
)
108-
sendEventForDeviceEvent(RNGestureHandlerStateChangeEvent.EVENT_NAME, data)
109-
} else {
110-
val event = RNGestureHandlerStateChangeEvent.obtain(
111-
handler,
112-
newState,
113-
oldState,
114-
handlerFactory.createEventBuilder(handler),
115-
)
116-
sendEventForDirectEvent(event)
117-
}
94+
val data = RNGestureHandlerStateChangeEvent.createEventData(
95+
handlerFactory.createEventBuilder(handler),
96+
newState,
97+
oldState,
98+
)
99+
sendEventForDeviceEvent(RNGestureHandlerStateChangeEvent.EVENT_NAME, data)
118100
}
119101
GestureHandler.ACTION_TYPE_JS_FUNCTION_NEW_API -> {
120102
// JS function or Animated.event with useNativeDriver: false with new API
@@ -160,13 +142,7 @@ class RNGestureHandlerEventDispatcher(private val reactApplicationContext: React
160142

161143
private fun <T : Event<T>> sendEventForReanimated(event: T) {
162144
// Delivers the event to Reanimated.
163-
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
164-
// Send event directly to Reanimated
165-
reanimatedEventDispatcher.sendEvent(event, reactApplicationContext)
166-
} else {
167-
// In the old architecture, Reanimated subscribes for specific direct events.
168-
sendEventForDirectEvent(event)
169-
}
145+
reanimatedEventDispatcher.sendEvent(event, reactApplicationContext)
170146
}
171147

172148
private fun sendEventForNativeAnimatedEvent(event: RNGestureHandlerEvent) {

0 commit comments

Comments
 (0)