-
-
Notifications
You must be signed in to change notification settings - Fork 788
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: patch react-native-gesture-handler for android
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |