Skip to content

Commit

Permalink
chore: add patches for RNGH
Browse files Browse the repository at this point in the history
  • Loading branch information
maciekstosio committed Oct 18, 2024
1 parent 446c8ea commit b7ff452
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
47 changes: 47 additions & 0 deletions Example/patches/react-native-gesture-handler+2.20.0.patch
Original file line number Diff line number Diff line change
@@ -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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>ScreensExample-android-react-native-gesture-handler</name>
+ <comment>Project ScreensExample-android-react-native-gesture-handler created by Buildship.</comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.buildship.core.gradleprojectbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.buildship.core.gradleprojectnature</nature>
+ </natures>
+ <filteredResources>
+ <filter>
+ <id>1729081513060</id>
+ <name></name>
+ <type>30</type>
+ <matcher>
+ <id>org.eclipse.core.resources.regexFilterMatcher</id>
+ <arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
+ </matcher>
+ </filter>
+ </filteredResources>
+</projectDescription>
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)
}
11 changes: 11 additions & 0 deletions FabricExample/patches/react-native-gesture-handler+2.20.0.patch
Original file line number Diff line number Diff line change
@@ -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)
}

0 comments on commit b7ff452

Please sign in to comment.