From b7ff45204330c13217a890ac84d552e65754407b Mon Sep 17 00:00:00 2001 From: Maciej Stosio Date: Fri, 18 Oct 2024 16:13:02 +0200 Subject: [PATCH] chore: add patches for RNGH --- .../react-native-gesture-handler+2.20.0.patch | 47 +++++++++++++++++++ .../react-native-gesture-handler+2.20.0.patch | 11 +++++ 2 files changed, 58 insertions(+) create mode 100644 Example/patches/react-native-gesture-handler+2.20.0.patch create mode 100644 FabricExample/patches/react-native-gesture-handler+2.20.0.patch diff --git a/Example/patches/react-native-gesture-handler+2.20.0.patch b/Example/patches/react-native-gesture-handler+2.20.0.patch new file mode 100644 index 000000000..2308ddf36 --- /dev/null +++ b/Example/patches/react-native-gesture-handler+2.20.0.patch @@ -0,0 +1,47 @@ +diff --git a/node_modules/react-native-gesture-handler/android/.project b/node_modules/react-native-gesture-handler/android/.project +new file mode 100644 +index 0000000..57b4b6d +--- /dev/null ++++ b/node_modules/react-native-gesture-handler/android/.project +@@ -0,0 +1,28 @@ ++ ++ ++ ScreensExample-android-react-native-gesture-handler ++ Project ScreensExample-android-react-native-gesture-handler created by Buildship. ++ ++ ++ ++ ++ org.eclipse.buildship.core.gradleprojectbuilder ++ ++ ++ ++ ++ ++ org.eclipse.buildship.core.gradleprojectnature ++ ++ ++ ++ 1729081513060 ++ ++ 30 ++ ++ org.eclipse.core.resources.regexFilterMatcher ++ node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ ++ ++ ++ ++ +diff --git a/node_modules/react-native-gesture-handler/android/paper/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt b/node_modules/react-native-gesture-handler/android/paper/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +index 574dcfc..7861838 100644 +--- a/node_modules/react-native-gesture-handler/android/paper/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt ++++ b/node_modules/react-native-gesture-handler/android/paper/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +@@ -6,7 +6,7 @@ import com.facebook.react.uimanager.events.Event + + fun ReactContext.dispatchEvent(event: Event<*>) { + try { +- this.getNativeModule(UIManagerModule::class.java)!!.getEventDispatcher().dispatchEvent(event) ++ this.getNativeModule(UIManagerModule::class.java)!!.eventDispatcher.dispatchEvent(event) + } catch (e: NullPointerException) { + throw Exception("Couldn't get an instance of UIManagerModule. Gesture Handler is unable to send an event.", e) + } diff --git a/FabricExample/patches/react-native-gesture-handler+2.20.0.patch b/FabricExample/patches/react-native-gesture-handler+2.20.0.patch new file mode 100644 index 000000000..0833a535f --- /dev/null +++ b/FabricExample/patches/react-native-gesture-handler+2.20.0.patch @@ -0,0 +1,11 @@ +diff --git a/node_modules/react-native-gesture-handler/android/fabric/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt b/node_modules/react-native-gesture-handler/android/fabric/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +index ff440de..2e05de9 100644 +--- a/node_modules/react-native-gesture-handler/android/fabric/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt ++++ b/node_modules/react-native-gesture-handler/android/fabric/src/main/java/com/swmansion/gesturehandler/ReactContextExtensions.kt +@@ -8,5 +8,5 @@ import com.facebook.react.uimanager.events.Event + + fun ReactContext.dispatchEvent(event: Event<*>) { + val fabricUIManager = UIManagerHelper.getUIManager(this, UIManagerType.FABRIC) as FabricUIManager +- fabricUIManager.getEventDispatcher().dispatchEvent(event) ++ fabricUIManager.eventDispatcher.dispatchEvent(event) + }