Skip to content

Commit

Permalink
chore: patch react-native-gesture-handler for android
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhom committed May 16, 2021
1 parent 400d7b9 commit 26a0d64
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions example/patches/react-native-gesture-handler+1.10.3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
diff --git a/node_modules/react-native-gesture-handler/android/lib/src/main/java/com/swmansion/gesturehandler/GestureHandlerOrchestrator.java b/node_modules/react-native-gesture-handler/android/lib/src/main/java/com/swmansion/gesturehandler/GestureHandlerOrchestrator.java
index f08713b..14f7729 100644
--- a/node_modules/react-native-gesture-handler/android/lib/src/main/java/com/swmansion/gesturehandler/GestureHandlerOrchestrator.java
+++ b/node_modules/react-native-gesture-handler/android/lib/src/main/java/com/swmansion/gesturehandler/GestureHandlerOrchestrator.java
@@ -13,6 +13,8 @@ import java.util.Comparator;

import androidx.annotation.Nullable;

+import com.swmansion.gesturehandler.react.RNGestureHandlerRootHelper;
+
public class GestureHandlerOrchestrator {

// The limit doesn't necessarily need to exists, it was just simpler to implement it that way
@@ -513,6 +515,7 @@ public class GestureHandlerOrchestrator {
}

private static boolean canRunSimultaneously(GestureHandler a, GestureHandler b) {
+
return a == b || a.shouldRecognizeSimultaneously(b) || b.shouldRecognizeSimultaneously(a);
}

@@ -533,6 +536,11 @@ public class GestureHandlerOrchestrator {
// state, we delegate the decision to the implementation of GestureHandler#shouldBeCancelledBy
return handler.shouldBeCancelledBy(other);
}
+
+ if (other instanceof RNGestureHandlerRootHelper.RootViewGestureHandler && handler instanceof PanGestureHandler) {
+ return false;
+ }
+
return true;
}

diff --git a/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.java b/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.java
index 9bf0c8f..8d4e58c 100644
--- a/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.java
+++ b/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.java
@@ -81,7 +81,7 @@ public class RNGestureHandlerRootHelper {
return mRootView;
}

- private class RootViewGestureHandler extends GestureHandler {
+ public class RootViewGestureHandler extends GestureHandler {
@Override
protected void onHandle(MotionEvent event) {
int currentState = getState();

0 comments on commit 26a0d64

Please sign in to comment.