/
react-native-gesture-handler+2.1.0.patch
48 lines (45 loc) 路 2.56 KB
/
react-native-gesture-handler+2.1.0.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
diff --git a/node_modules/react-native-gesture-handler/android/lib/src/main/java/com/swmansion/gesturehandler/GestureHandlerOrchestrator.kt b/node_modules/react-native-gesture-handler/android/lib/src/main/java/com/swmansion/gesturehandler/GestureHandlerOrchestrator.kt
index 51be37c..cb507d4 100644
--- a/node_modules/react-native-gesture-handler/android/lib/src/main/java/com/swmansion/gesturehandler/GestureHandlerOrchestrator.kt
+++ b/node_modules/react-native-gesture-handler/android/lib/src/main/java/com/swmansion/gesturehandler/GestureHandlerOrchestrator.kt
@@ -5,6 +5,7 @@ import android.graphics.PointF
import android.view.MotionEvent
import android.view.View
import android.view.ViewGroup
+import com.swmansion.gesturehandler.react.RNGestureHandlerRootHelper
import java.util.*
class GestureHandlerOrchestrator(
@@ -546,12 +547,19 @@ class GestureHandlerOrchestrator(
// in began state
return false
}
- return if (handler !== other &&
+
+ if (handler !== other &&
(handler.isAwaiting || handler.state == GestureHandler.STATE_ACTIVE)) {
// in every other case as long as the handler is about to be activated or already in active
// state, we delegate the decision to the implementation of GestureHandler#shouldBeCancelledBy
- handler.shouldBeCancelledBy(other)
- } else true
+ return handler.shouldBeCancelledBy(other)
+ }
+
+ if (other is RNGestureHandlerRootHelper.RootViewGestureHandler && handler is PanGestureHandler) {
+ return false;
+ }
+
+ return true
}
private fun isFinished(state: Int) =
diff --git a/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.kt b/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.kt
index 8c20453..dcf54dd 100644
--- a/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.kt
+++ b/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.kt
@@ -53,7 +53,7 @@ class RNGestureHandlerRootHelper(private val context: ReactContext, wrappedView:
}
}
- private inner class RootViewGestureHandler : GestureHandler<RootViewGestureHandler>() {
+ inner class RootViewGestureHandler : GestureHandler<RootViewGestureHandler>() {
override fun onHandle(event: MotionEvent) {
val currentState = state
if (currentState == STATE_UNDETERMINED) {