react-native-gesture-handler 2.8.0 → 2.10.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -0
- package/RNGestureHandler.podspec +2 -2
- package/android/build.gradle +107 -65
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandler.kt +1 -1
- package/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt +2 -0
- package/android/src/main/java/com/swmansion/gesturehandler/core/NativeViewGestureHandler.kt +39 -0
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt +9 -2
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEvent.kt +14 -2
- package/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerModule.kt +5 -1
- package/android/src/main/jni/CMakeLists.txt +10 -44
- package/android/src/main/jni/cpp-adapter.cpp +16 -13
- package/ios/Handlers/RNFlingHandler.m +39 -37
- package/ios/Handlers/RNForceTouchHandler.m +19 -17
- package/ios/Handlers/RNLongPressHandler.m +20 -22
- package/ios/Handlers/RNManualHandler.m +2 -3
- package/ios/Handlers/RNNativeViewHandler.mm +96 -92
- package/ios/Handlers/RNPanHandler.m +28 -32
- package/ios/Handlers/RNPinchHandler.m +9 -10
- package/ios/Handlers/RNRotationHandler.m +11 -14
- package/ios/Handlers/RNTapHandler.m +26 -26
- package/ios/RNGestureHandler.h +31 -24
- package/ios/RNGestureHandler.m +278 -273
- package/ios/RNGestureHandlerActionType.h +6 -4
- package/ios/RNGestureHandlerButton.m +11 -12
- package/ios/RNGestureHandlerButtonComponentView.h +2 -2
- package/ios/RNGestureHandlerButtonComponentView.mm +2 -2
- package/ios/RNGestureHandlerButtonManager.m +6 -5
- package/ios/RNGestureHandlerDirection.h +4 -4
- package/ios/RNGestureHandlerEvents.h +3 -4
- package/ios/RNGestureHandlerEvents.m +114 -119
- package/ios/RNGestureHandlerManager.h +1 -2
- package/ios/RNGestureHandlerManager.mm +9 -9
- package/ios/RNGestureHandlerModule.h +1 -2
- package/ios/RNGestureHandlerModule.mm +142 -138
- package/ios/RNGestureHandlerPointerTracker.h +1 -1
- package/ios/RNGestureHandlerPointerTracker.m +40 -37
- package/ios/RNGestureHandlerRegistry.h +3 -1
- package/ios/RNGestureHandlerRegistry.m +24 -22
- package/ios/RNGestureHandlerRootViewComponentView.mm +2 -2
- package/ios/RNGestureHandlerState.h +6 -6
- package/ios/RNGestureHandlerStateManager.h +1 -1
- package/ios/RNManualActivationRecognizer.m +9 -9
- package/ios/RNRootViewGestureRecognizer.m +39 -42
- package/lib/commonjs/EnableNewWebImplementation.js +35 -0
- package/lib/commonjs/EnableNewWebImplementation.js.map +1 -0
- package/lib/commonjs/GestureHandlerRootViewContext.js +15 -0
- package/lib/commonjs/GestureHandlerRootViewContext.js.map +1 -0
- package/lib/commonjs/RNGestureHandlerModule.macos.js +6 -6
- package/lib/commonjs/RNGestureHandlerModule.macos.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.web.js +6 -6
- package/lib/commonjs/RNGestureHandlerModule.web.js.map +1 -1
- package/lib/commonjs/RNGestureHandlerModule.windows.js +6 -6
- package/lib/commonjs/RNGestureHandlerModule.windows.js.map +1 -1
- package/lib/commonjs/components/DrawerLayout.js.map +1 -1
- package/lib/commonjs/components/GestureComponents.web.js +6 -5
- package/lib/commonjs/components/GestureComponents.web.js.map +1 -1
- package/lib/commonjs/components/GestureHandlerButton.js +3 -5
- package/lib/commonjs/components/GestureHandlerButton.js.map +1 -1
- package/lib/commonjs/{GestureHandlerRootView.android.js → components/GestureHandlerRootView.android.js} +8 -7
- package/lib/commonjs/components/GestureHandlerRootView.android.js.map +1 -0
- package/lib/commonjs/{GestureHandlerRootView.js → components/GestureHandlerRootView.js} +8 -2
- package/lib/commonjs/components/GestureHandlerRootView.js.map +1 -0
- package/lib/commonjs/{GestureHandlerRootView.web.js → components/GestureHandlerRootView.web.js} +7 -1
- package/lib/commonjs/components/GestureHandlerRootView.web.js.map +1 -0
- package/lib/commonjs/components/Swipeable.js +17 -3
- package/lib/commonjs/components/Swipeable.js.map +1 -1
- package/lib/commonjs/{gestureHandlerRootHOC.js → components/gestureHandlerRootHOC.js} +2 -1
- package/lib/commonjs/components/gestureHandlerRootHOC.js.map +1 -0
- package/lib/commonjs/handlers/LongPressGestureHandler.js +3 -1
- package/lib/commonjs/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/TapGestureHandler.js +3 -1
- package/lib/commonjs/handlers/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/handlers/createHandler.js +21 -13
- package/lib/commonjs/handlers/createHandler.js.map +1 -1
- package/lib/commonjs/handlers/gestureHandlerCommon.js +5 -4
- package/lib/commonjs/handlers/gestureHandlerCommon.js.map +1 -1
- package/lib/commonjs/handlers/gestures/GestureDetector.js +89 -37
- package/lib/commonjs/handlers/gestures/GestureDetector.js.map +1 -1
- package/lib/commonjs/handlers/gestures/longPressGesture.js +1 -0
- package/lib/commonjs/handlers/gestures/longPressGesture.js.map +1 -1
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js +22 -19
- package/lib/commonjs/handlers/gestures/reanimatedWrapper.js.map +1 -1
- package/lib/commonjs/handlers/gestures/tapGesture.js +1 -0
- package/lib/commonjs/handlers/gestures/tapGesture.js.map +1 -1
- package/lib/commonjs/index.js +16 -4
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/utils.js +0 -6
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/commonjs/web/handlers/FlingGestureHandler.js +0 -5
- package/lib/commonjs/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/GestureHandler.js +3 -0
- package/lib/commonjs/web/handlers/GestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js +0 -1
- package/lib/commonjs/web/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/ManualGestureHandler.js +0 -5
- package/lib/commonjs/web/handlers/ManualGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js +0 -6
- package/lib/commonjs/web/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/PanGestureHandler.js +2 -12
- package/lib/commonjs/web/handlers/PanGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/PinchGestureHandler.js +0 -5
- package/lib/commonjs/web/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/RotationGestureHandler.js +0 -6
- package/lib/commonjs/web/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/commonjs/web/handlers/TapGestureHandler.js +0 -7
- package/lib/commonjs/web/handlers/TapGestureHandler.js.map +1 -1
- package/lib/commonjs/web/tools/CircularBuffer.js +59 -0
- package/lib/commonjs/web/tools/CircularBuffer.js.map +1 -0
- package/lib/commonjs/web/tools/LeastSquareSolver.js +204 -0
- package/lib/commonjs/web/tools/LeastSquareSolver.js.map +1 -0
- package/lib/commonjs/web/tools/PointerEventManager.js +27 -0
- package/lib/commonjs/web/tools/PointerEventManager.js.map +1 -1
- package/lib/commonjs/web/tools/PointerTracker.js +11 -7
- package/lib/commonjs/web/tools/PointerTracker.js.map +1 -1
- package/lib/commonjs/web/tools/VelocityTracker.js +111 -0
- package/lib/commonjs/web/tools/VelocityTracker.js.map +1 -0
- package/lib/commonjs/web_hammer/GestureHandler.js +1 -1
- package/lib/commonjs/web_hammer/GestureHandler.js.map +1 -1
- package/lib/module/EnableNewWebImplementation.js +22 -0
- package/lib/module/EnableNewWebImplementation.js.map +1 -0
- package/lib/module/GestureHandlerRootViewContext.js +3 -0
- package/lib/module/GestureHandlerRootViewContext.js.map +1 -0
- package/lib/module/RNGestureHandlerModule.macos.js +6 -6
- package/lib/module/RNGestureHandlerModule.macos.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.web.js +6 -6
- package/lib/module/RNGestureHandlerModule.web.js.map +1 -1
- package/lib/module/RNGestureHandlerModule.windows.js +6 -6
- package/lib/module/RNGestureHandlerModule.windows.js.map +1 -1
- package/lib/module/components/DrawerLayout.js.map +1 -1
- package/lib/module/components/GestureComponents.web.js +5 -6
- package/lib/module/components/GestureComponents.web.js.map +1 -1
- package/lib/module/components/GestureHandlerButton.js +1 -4
- package/lib/module/components/GestureHandlerButton.js.map +1 -1
- package/lib/module/components/GestureHandlerRootView.android.js +14 -0
- package/lib/module/components/GestureHandlerRootView.android.js.map +1 -0
- package/lib/module/{GestureHandlerRootView.js → components/GestureHandlerRootView.js} +5 -2
- package/lib/module/components/GestureHandlerRootView.js.map +1 -0
- package/lib/module/components/GestureHandlerRootView.web.js +9 -0
- package/lib/module/components/GestureHandlerRootView.web.js.map +1 -0
- package/lib/module/components/Swipeable.js +17 -3
- package/lib/module/components/Swipeable.js.map +1 -1
- package/lib/module/{gestureHandlerRootHOC.js → components/gestureHandlerRootHOC.js} +2 -1
- package/lib/module/components/gestureHandlerRootHOC.js.map +1 -0
- package/lib/module/handlers/LongPressGestureHandler.js +3 -1
- package/lib/module/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/module/handlers/TapGestureHandler.js +3 -1
- package/lib/module/handlers/TapGestureHandler.js.map +1 -1
- package/lib/module/handlers/createHandler.js +20 -13
- package/lib/module/handlers/createHandler.js.map +1 -1
- package/lib/module/handlers/gestureHandlerCommon.js +5 -4
- package/lib/module/handlers/gestureHandlerCommon.js.map +1 -1
- package/lib/module/handlers/gestures/GestureDetector.js +89 -38
- package/lib/module/handlers/gestures/GestureDetector.js.map +1 -1
- package/lib/module/handlers/gestures/longPressGesture.js +1 -0
- package/lib/module/handlers/gestures/longPressGesture.js.map +1 -1
- package/lib/module/handlers/gestures/reanimatedWrapper.js +19 -16
- package/lib/module/handlers/gestures/reanimatedWrapper.js.map +1 -1
- package/lib/module/handlers/gestures/tapGesture.js +1 -0
- package/lib/module/handlers/gestures/tapGesture.js.map +1 -1
- package/lib/module/index.js +4 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils.js +0 -4
- package/lib/module/utils.js.map +1 -1
- package/lib/module/web/handlers/FlingGestureHandler.js +0 -5
- package/lib/module/web/handlers/FlingGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/GestureHandler.js +3 -0
- package/lib/module/web/handlers/GestureHandler.js.map +1 -1
- package/lib/module/web/handlers/LongPressGestureHandler.js +0 -1
- package/lib/module/web/handlers/LongPressGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/ManualGestureHandler.js +0 -5
- package/lib/module/web/handlers/ManualGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/NativeViewGestureHandler.js +0 -6
- package/lib/module/web/handlers/NativeViewGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/PanGestureHandler.js +2 -9
- package/lib/module/web/handlers/PanGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/PinchGestureHandler.js +0 -5
- package/lib/module/web/handlers/PinchGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/RotationGestureHandler.js +0 -6
- package/lib/module/web/handlers/RotationGestureHandler.js.map +1 -1
- package/lib/module/web/handlers/TapGestureHandler.js +0 -7
- package/lib/module/web/handlers/TapGestureHandler.js.map +1 -1
- package/lib/module/web/tools/CircularBuffer.js +50 -0
- package/lib/module/web/tools/CircularBuffer.js.map +1 -0
- package/lib/module/web/tools/LeastSquareSolver.js +195 -0
- package/lib/module/web/tools/LeastSquareSolver.js.map +1 -0
- package/lib/module/web/tools/PointerEventManager.js +27 -0
- package/lib/module/web/tools/PointerEventManager.js.map +1 -1
- package/lib/module/web/tools/PointerTracker.js +8 -7
- package/lib/module/web/tools/PointerTracker.js.map +1 -1
- package/lib/module/web/tools/VelocityTracker.js +98 -0
- package/lib/module/web/tools/VelocityTracker.js.map +1 -0
- package/lib/module/web_hammer/GestureHandler.js +1 -1
- package/lib/module/web_hammer/GestureHandler.js.map +1 -1
- package/lib/typescript/EnableNewWebImplementation.d.ts +3 -0
- package/lib/typescript/GestureHandlerRootViewContext.d.ts +3 -0
- package/lib/typescript/components/DrawerLayout.d.ts +3 -1
- package/lib/typescript/components/GestureComponents.web.d.ts +1 -1
- package/lib/typescript/components/Swipeable.d.ts +14 -2
- package/lib/typescript/components/gestureHandlerRootHOC.d.ts +3 -0
- package/lib/typescript/index.d.ts +4 -4
- package/lib/typescript/{fabric → specs}/RNGestureHandlerButtonNativeComponent.d.ts +1 -1
- package/lib/typescript/{fabric → specs}/RNGestureHandlerRootViewNativeComponent.d.ts +1 -1
- package/lib/typescript/utils.d.ts +0 -1
- package/lib/typescript/web/handlers/FlingGestureHandler.d.ts +0 -1
- package/lib/typescript/web/handlers/ManualGestureHandler.d.ts +0 -1
- package/lib/typescript/web/handlers/NativeViewGestureHandler.d.ts +0 -1
- package/lib/typescript/web/handlers/PanGestureHandler.d.ts +0 -1
- package/lib/typescript/web/handlers/PinchGestureHandler.d.ts +0 -1
- package/lib/typescript/web/handlers/RotationGestureHandler.d.ts +0 -1
- package/lib/typescript/web/handlers/TapGestureHandler.d.ts +0 -1
- package/lib/typescript/web/tools/CircularBuffer.d.ts +11 -0
- package/lib/typescript/web/tools/LeastSquareSolver.d.ts +12 -0
- package/lib/typescript/web/tools/PointerEventManager.d.ts +2 -0
- package/lib/typescript/web/tools/PointerTracker.d.ts +1 -0
- package/lib/typescript/web/tools/VelocityTracker.d.ts +13 -0
- package/package.json +6 -7
- package/src/EnableNewWebImplementation.ts +35 -0
- package/src/GestureHandlerRootViewContext.ts +3 -0
- package/src/RNGestureHandlerModule.macos.ts +6 -6
- package/src/RNGestureHandlerModule.web.ts +6 -6
- package/src/RNGestureHandlerModule.windows.ts +6 -6
- package/src/components/DrawerLayout.tsx +8 -4
- package/src/components/GestureComponents.web.tsx +5 -6
- package/src/components/GestureHandlerButton.tsx +2 -7
- package/src/components/GestureHandlerRootView.android.tsx +24 -0
- package/src/{GestureHandlerRootView.tsx → components/GestureHandlerRootView.tsx} +7 -2
- package/src/{GestureHandlerRootView.web.tsx → components/GestureHandlerRootView.web.tsx} +6 -1
- package/src/components/Swipeable.tsx +43 -12
- package/src/{gestureHandlerRootHOC.tsx → components/gestureHandlerRootHOC.tsx} +4 -1
- package/src/handlers/LongPressGestureHandler.ts +3 -1
- package/src/handlers/TapGestureHandler.ts +3 -1
- package/src/handlers/createHandler.tsx +20 -9
- package/src/handlers/gestureHandlerCommon.ts +5 -6
- package/src/handlers/gestures/GestureDetector.tsx +99 -36
- package/src/handlers/gestures/longPressGesture.ts +1 -0
- package/src/handlers/gestures/reanimatedWrapper.ts +21 -20
- package/src/handlers/gestures/tapGesture.ts +1 -0
- package/src/index.ts +7 -3
- package/src/utils.ts +0 -5
- package/src/web/handlers/FlingGestureHandler.ts +0 -5
- package/src/web/handlers/GestureHandler.ts +3 -0
- package/src/web/handlers/LongPressGestureHandler.ts +0 -1
- package/src/web/handlers/ManualGestureHandler.ts +0 -5
- package/src/web/handlers/NativeViewGestureHandler.ts +0 -6
- package/src/web/handlers/PanGestureHandler.ts +2 -9
- package/src/web/handlers/PinchGestureHandler.ts +0 -5
- package/src/web/handlers/RotationGestureHandler.ts +0 -7
- package/src/web/handlers/TapGestureHandler.ts +0 -7
- package/src/web/tools/CircularBuffer.ts +42 -0
- package/src/web/tools/LeastSquareSolver.ts +182 -0
- package/src/web/tools/PointerEventManager.ts +29 -0
- package/src/web/tools/PointerTracker.ts +7 -7
- package/src/web/tools/VelocityTracker.ts +98 -0
- package/src/web_hammer/GestureHandler.ts +1 -1
- package/lib/commonjs/EnableExperimentalWebImplementation.js +0 -31
- package/lib/commonjs/EnableExperimentalWebImplementation.js.map +0 -1
- package/lib/commonjs/GestureHandlerRootView.android.js.map +0 -1
- package/lib/commonjs/GestureHandlerRootView.js.map +0 -1
- package/lib/commonjs/GestureHandlerRootView.web.js.map +0 -1
- package/lib/commonjs/gestureHandlerRootHOC.js.map +0 -1
- package/lib/module/EnableExperimentalWebImplementation.js +0 -20
- package/lib/module/EnableExperimentalWebImplementation.js.map +0 -1
- package/lib/module/GestureHandlerRootView.android.js +0 -14
- package/lib/module/GestureHandlerRootView.android.js.map +0 -1
- package/lib/module/GestureHandlerRootView.js.map +0 -1
- package/lib/module/GestureHandlerRootView.web.js +0 -6
- package/lib/module/GestureHandlerRootView.web.js.map +0 -1
- package/lib/module/gestureHandlerRootHOC.js.map +0 -1
- package/lib/typescript/EnableExperimentalWebImplementation.d.ts +0 -2
- package/lib/typescript/gestureHandlerRootHOC.d.ts +0 -3
- package/src/EnableExperimentalWebImplementation.ts +0 -27
- package/src/GestureHandlerRootView.android.tsx +0 -24
- /package/lib/commonjs/{fabric → specs}/RNGestureHandlerButtonNativeComponent.js +0 -0
- /package/lib/commonjs/{fabric → specs}/RNGestureHandlerButtonNativeComponent.js.map +0 -0
- /package/lib/commonjs/{fabric → specs}/RNGestureHandlerRootViewNativeComponent.js +0 -0
- /package/lib/commonjs/{fabric → specs}/RNGestureHandlerRootViewNativeComponent.js.map +0 -0
- /package/lib/module/{fabric → specs}/RNGestureHandlerButtonNativeComponent.js +0 -0
- /package/lib/module/{fabric → specs}/RNGestureHandlerButtonNativeComponent.js.map +0 -0
- /package/lib/module/{fabric → specs}/RNGestureHandlerRootViewNativeComponent.js +0 -0
- /package/lib/module/{fabric → specs}/RNGestureHandlerRootViewNativeComponent.js.map +0 -0
- /package/lib/typescript/{GestureHandlerRootView.android.d.ts → components/GestureHandlerRootView.android.d.ts} +0 -0
- /package/lib/typescript/{GestureHandlerRootView.d.ts → components/GestureHandlerRootView.d.ts} +0 -0
- /package/lib/typescript/{GestureHandlerRootView.web.d.ts → components/GestureHandlerRootView.web.d.ts} +0 -0
- /package/src/{fabric → specs}/RNGestureHandlerButtonNativeComponent.ts +0 -0
- /package/src/{fabric → specs}/RNGestureHandlerRootViewNativeComponent.ts +0 -0
@@ -1,37 +1,37 @@
|
|
1
1
|
#import "RNGestureHandlerModule.h"
|
2
2
|
|
3
|
-
#import <React/RCTLog.h>
|
4
|
-
#import <React/RCTViewManager.h>
|
5
3
|
#import <React/RCTComponent.h>
|
4
|
+
#import <React/RCTLog.h>
|
6
5
|
#import <React/RCTUIManager.h>
|
7
|
-
#import <React/RCTUIManagerUtils.h>
|
8
6
|
#import <React/RCTUIManagerObserverCoordinator.h>
|
7
|
+
#import <React/RCTUIManagerUtils.h>
|
8
|
+
#import <React/RCTViewManager.h>
|
9
9
|
|
10
|
-
#ifdef
|
11
|
-
#import <React/RCTBridge.h>
|
12
|
-
#import <ReactCommon/RCTTurboModule.h>
|
10
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
13
11
|
#import <React/RCTBridge+Private.h>
|
14
|
-
#import <
|
15
|
-
#import <React/RCTUtils.h>
|
12
|
+
#import <React/RCTBridge.h>
|
16
13
|
#import <React/RCTSurfacePresenter.h>
|
14
|
+
#import <React/RCTUtils.h>
|
15
|
+
#import <ReactCommon/CallInvoker.h>
|
16
|
+
#import <ReactCommon/RCTTurboModule.h>
|
17
17
|
|
18
18
|
#import <react/renderer/uimanager/primitives.h>
|
19
|
-
#endif //
|
19
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
20
20
|
|
21
|
-
#import "RNGestureHandlerState.h"
|
22
|
-
#import "RNGestureHandlerDirection.h"
|
23
21
|
#import "RNGestureHandler.h"
|
22
|
+
#import "RNGestureHandlerDirection.h"
|
24
23
|
#import "RNGestureHandlerManager.h"
|
24
|
+
#import "RNGestureHandlerState.h"
|
25
25
|
|
26
26
|
#import "RNGestureHandlerButton.h"
|
27
27
|
#import "RNGestureHandlerStateManager.h"
|
28
28
|
|
29
|
-
#ifdef
|
29
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
30
30
|
using namespace facebook;
|
31
31
|
using namespace react;
|
32
|
-
#endif //
|
32
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
33
33
|
|
34
|
-
#ifdef
|
34
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
35
35
|
@interface RNGestureHandlerModule () <RCTSurfacePresenterObserver, RNGestureHandlerStateManager>
|
36
36
|
|
37
37
|
@end
|
@@ -39,66 +39,60 @@ using namespace react;
|
|
39
39
|
@interface RNGestureHandlerModule () <RCTUIManagerObserver, RNGestureHandlerStateManager>
|
40
40
|
|
41
41
|
@end
|
42
|
-
#endif //
|
42
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
43
43
|
|
44
44
|
typedef void (^GestureHandlerOperation)(RNGestureHandlerManager *manager);
|
45
45
|
|
46
|
-
@implementation RNGestureHandlerModule
|
47
|
-
|
48
|
-
RNGestureHandlerManager *_manager;
|
46
|
+
@implementation RNGestureHandlerModule {
|
47
|
+
RNGestureHandlerManager *_manager;
|
49
48
|
|
50
|
-
|
51
|
-
|
49
|
+
// Oparations called after views have been updated.
|
50
|
+
NSMutableArray<GestureHandlerOperation> *_operations;
|
52
51
|
}
|
53
52
|
|
54
53
|
RCT_EXPORT_MODULE()
|
55
54
|
|
56
55
|
+ (BOOL)requiresMainQueueSetup
|
57
56
|
{
|
58
|
-
|
57
|
+
return YES;
|
59
58
|
}
|
60
59
|
|
61
60
|
- (void)invalidate
|
62
61
|
{
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
#ifdef
|
71
|
-
|
62
|
+
RNGestureHandlerManager *handlerManager = _manager;
|
63
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
64
|
+
[handlerManager dropAllGestureHandlers];
|
65
|
+
});
|
66
|
+
|
67
|
+
_manager = nil;
|
68
|
+
|
69
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
70
|
+
[self.bridge.surfacePresenter removeObserver:self];
|
72
71
|
#else
|
73
|
-
|
74
|
-
#endif //
|
72
|
+
[self.bridge.uiManager.observerCoordinator removeObserver:self];
|
73
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
75
74
|
}
|
76
75
|
|
77
76
|
- (dispatch_queue_t)methodQueue
|
78
77
|
{
|
79
|
-
|
80
|
-
|
81
|
-
|
78
|
+
// This module needs to be on the same queue as the UIManager to avoid
|
79
|
+
// having to lock `_operations` and `_preOperations` since `uiManagerWillFlushUIBlocks`
|
80
|
+
// will be called from that queue.
|
82
81
|
|
83
|
-
|
84
|
-
|
85
|
-
|
82
|
+
// This is required as this module rely on having all the view nodes created before
|
83
|
+
// gesture handlers can be associated with them
|
84
|
+
return RCTGetUIManagerQueue();
|
86
85
|
}
|
87
86
|
|
88
|
-
#ifdef
|
87
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
89
88
|
void decorateRuntime(jsi::Runtime &runtime)
|
90
89
|
{
|
91
90
|
auto isFormsStackingContext = jsi::Function::createFromHostFunction(
|
92
91
|
runtime,
|
93
92
|
jsi::PropNameID::forAscii(runtime, "isFormsStackingContext"),
|
94
93
|
1,
|
95
|
-
[](jsi::Runtime &runtime,
|
96
|
-
|
97
|
-
const jsi::Value *arguments,
|
98
|
-
size_t count) -> jsi::Value
|
99
|
-
{
|
100
|
-
if (!arguments[0].isObject())
|
101
|
-
{
|
94
|
+
[](jsi::Runtime &runtime, const jsi::Value &thisValue, const jsi::Value *arguments, size_t count) -> jsi::Value {
|
95
|
+
if (!arguments[0].isObject()) {
|
102
96
|
return jsi::Value::null();
|
103
97
|
}
|
104
98
|
|
@@ -109,89 +103,100 @@ void decorateRuntime(jsi::Runtime &runtime)
|
|
109
103
|
});
|
110
104
|
runtime.global().setProperty(runtime, "isFormsStackingContext", std::move(isFormsStackingContext));
|
111
105
|
}
|
112
|
-
#endif //
|
106
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
113
107
|
|
114
108
|
- (void)setBridge:(RCTBridge *)bridge
|
115
109
|
{
|
116
|
-
|
110
|
+
[super setBridge:bridge];
|
117
111
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
_operations = [NSMutableArray new];
|
112
|
+
_manager = [[RNGestureHandlerManager alloc] initWithUIManager:bridge.uiManager
|
113
|
+
eventDispatcher:bridge.eventDispatcher];
|
114
|
+
_operations = [NSMutableArray new];
|
122
115
|
|
123
|
-
#ifdef
|
124
|
-
|
116
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
117
|
+
[bridge.surfacePresenter addObserver:self];
|
125
118
|
#else
|
126
|
-
|
127
|
-
#endif //
|
119
|
+
[bridge.uiManager.observerCoordinator addObserver:self];
|
120
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
128
121
|
}
|
129
122
|
|
130
|
-
#ifdef
|
131
|
-
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(install)
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
123
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
124
|
+
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(install)
|
125
|
+
{
|
126
|
+
RCTCxxBridge *cxxBridge = (RCTCxxBridge *)self.bridge;
|
127
|
+
auto runtime = (jsi::Runtime *)cxxBridge.runtime;
|
128
|
+
decorateRuntime(*runtime);
|
129
|
+
return @true;
|
136
130
|
}
|
137
|
-
#endif //
|
131
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
138
132
|
|
139
|
-
RCT_EXPORT_METHOD(createGestureHandler
|
133
|
+
RCT_EXPORT_METHOD(createGestureHandler
|
134
|
+
: (nonnull NSString *)handlerName tag
|
135
|
+
: (nonnull NSNumber *)handlerTag config
|
136
|
+
: (NSDictionary *)config)
|
140
137
|
{
|
141
|
-
|
142
|
-
|
143
|
-
|
138
|
+
[self addOperationBlock:^(RNGestureHandlerManager *manager) {
|
139
|
+
[manager createGestureHandler:handlerName tag:handlerTag config:config];
|
140
|
+
}];
|
144
141
|
}
|
145
142
|
|
146
|
-
RCT_EXPORT_METHOD(attachGestureHandler
|
143
|
+
RCT_EXPORT_METHOD(attachGestureHandler
|
144
|
+
: (nonnull NSNumber *)handlerTag toViewWithTag
|
145
|
+
: (nonnull NSNumber *)viewTag actionType
|
146
|
+
: (nonnull NSNumber *)actionType)
|
147
147
|
{
|
148
|
-
|
149
|
-
|
150
|
-
|
148
|
+
[self addOperationBlock:^(RNGestureHandlerManager *manager) {
|
149
|
+
[manager attachGestureHandler:handlerTag
|
150
|
+
toViewWithTag:viewTag
|
151
|
+
withActionType:(RNGestureHandlerActionType)[actionType integerValue]];
|
152
|
+
}];
|
151
153
|
}
|
152
154
|
|
153
|
-
RCT_EXPORT_METHOD(updateGestureHandler:(nonnull NSNumber *)handlerTag config:(NSDictionary *)config)
|
155
|
+
RCT_EXPORT_METHOD(updateGestureHandler : (nonnull NSNumber *)handlerTag config : (NSDictionary *)config)
|
154
156
|
{
|
155
|
-
|
156
|
-
|
157
|
-
|
157
|
+
[self addOperationBlock:^(RNGestureHandlerManager *manager) {
|
158
|
+
[manager updateGestureHandler:handlerTag config:config];
|
159
|
+
}];
|
158
160
|
}
|
159
161
|
|
160
|
-
RCT_EXPORT_METHOD(dropGestureHandler:(nonnull NSNumber *)handlerTag)
|
162
|
+
RCT_EXPORT_METHOD(dropGestureHandler : (nonnull NSNumber *)handlerTag)
|
161
163
|
{
|
162
|
-
|
163
|
-
|
164
|
-
|
164
|
+
[self addOperationBlock:^(RNGestureHandlerManager *manager) {
|
165
|
+
[manager dropGestureHandler:handlerTag];
|
166
|
+
}];
|
165
167
|
}
|
166
168
|
|
167
|
-
RCT_EXPORT_METHOD(handleSetJSResponder
|
169
|
+
RCT_EXPORT_METHOD(handleSetJSResponder
|
170
|
+
: (nonnull NSNumber *)viewTag blockNativeResponder
|
171
|
+
: (nonnull NSNumber *)blockNativeResponder)
|
168
172
|
{
|
169
|
-
|
170
|
-
|
171
|
-
|
173
|
+
[self addOperationBlock:^(RNGestureHandlerManager *manager) {
|
174
|
+
[manager handleSetJSResponder:viewTag blockNativeResponder:blockNativeResponder];
|
175
|
+
}];
|
172
176
|
}
|
173
177
|
|
174
178
|
RCT_EXPORT_METHOD(handleClearJSResponder)
|
175
179
|
{
|
176
|
-
|
177
|
-
|
178
|
-
|
180
|
+
[self addOperationBlock:^(RNGestureHandlerManager *manager) {
|
181
|
+
[manager handleClearJSResponder];
|
182
|
+
}];
|
179
183
|
}
|
180
184
|
|
181
185
|
RCT_EXPORT_METHOD(flushOperations)
|
182
186
|
{
|
183
|
-
|
184
|
-
|
185
|
-
|
187
|
+
if (_operations.count == 0) {
|
188
|
+
return;
|
189
|
+
}
|
186
190
|
|
187
|
-
|
188
|
-
|
191
|
+
NSArray<GestureHandlerOperation> *operations = _operations;
|
192
|
+
_operations = [NSMutableArray new];
|
189
193
|
|
190
|
-
|
194
|
+
[self.bridge.uiManager
|
195
|
+
addUIBlock:^(__unused RCTUIManager *manager, __unused NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
191
196
|
for (GestureHandlerOperation operation in operations) {
|
192
|
-
|
197
|
+
operation(self->_manager);
|
193
198
|
}
|
194
|
-
|
199
|
+
}];
|
195
200
|
}
|
196
201
|
|
197
202
|
- (void)setGestureState:(int)state forHandler:(int)handlerTag
|
@@ -212,12 +217,12 @@ RCT_EXPORT_METHOD(flushOperations)
|
|
212
217
|
handler.recognizer.state = UIGestureRecognizerStateEnded;
|
213
218
|
}
|
214
219
|
}
|
215
|
-
|
220
|
+
|
216
221
|
// if the gesture was set to finish, cancel all pointers it was tracking
|
217
222
|
if (state == 1 || state == 3 || state == 5) {
|
218
223
|
[handler.pointerTracker cancelPointers];
|
219
224
|
}
|
220
|
-
|
225
|
+
|
221
226
|
// do not send state change event when activating because it bypasses
|
222
227
|
// shouldRequireFailureOfGestureRecognizer
|
223
228
|
if (state != 4) {
|
@@ -225,31 +230,31 @@ RCT_EXPORT_METHOD(flushOperations)
|
|
225
230
|
}
|
226
231
|
}
|
227
232
|
|
228
|
-
#pragma mark
|
233
|
+
#pragma mark-- Batch handling
|
229
234
|
|
230
235
|
- (void)addOperationBlock:(GestureHandlerOperation)operation
|
231
236
|
{
|
232
|
-
|
237
|
+
[_operations addObject:operation];
|
233
238
|
}
|
234
239
|
|
235
240
|
#pragma mark - RCTSurfacePresenterObserver
|
236
241
|
|
237
|
-
#ifdef
|
242
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
238
243
|
|
239
244
|
- (void)didMountComponentsWithRootTag:(NSInteger)rootTag
|
240
245
|
{
|
241
|
-
|
242
|
-
|
243
|
-
if (_operations.count == 0) {
|
244
|
-
return;
|
245
|
-
}
|
246
|
+
RCTAssertMainQueue();
|
246
247
|
|
247
|
-
|
248
|
-
|
248
|
+
if (_operations.count == 0) {
|
249
|
+
return;
|
250
|
+
}
|
249
251
|
|
250
|
-
|
251
|
-
|
252
|
-
|
252
|
+
NSArray<GestureHandlerOperation> *operations = _operations;
|
253
|
+
_operations = [NSMutableArray new];
|
254
|
+
|
255
|
+
for (GestureHandlerOperation operation in operations) {
|
256
|
+
operation(self->_manager);
|
257
|
+
}
|
253
258
|
}
|
254
259
|
|
255
260
|
#else
|
@@ -263,50 +268,49 @@ RCT_EXPORT_METHOD(flushOperations)
|
|
263
268
|
|
264
269
|
- (void)uiManagerWillPerformMounting:(RCTUIManager *)uiManager
|
265
270
|
{
|
266
|
-
|
267
|
-
|
268
|
-
|
271
|
+
if (_operations.count == 0) {
|
272
|
+
return;
|
273
|
+
}
|
269
274
|
|
270
|
-
|
271
|
-
|
275
|
+
NSArray<GestureHandlerOperation> *operations = _operations;
|
276
|
+
_operations = [NSMutableArray new];
|
272
277
|
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
+
[uiManager addUIBlock:^(__unused RCTUIManager *manager, __unused NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
279
|
+
for (GestureHandlerOperation operation in operations) {
|
280
|
+
operation(self->_manager);
|
281
|
+
}
|
282
|
+
}];
|
278
283
|
}
|
279
284
|
|
280
|
-
#endif //
|
285
|
+
#endif // RCT_NEW_ARCH_ENABLED
|
281
286
|
|
282
287
|
#pragma mark Events
|
283
288
|
|
284
289
|
- (NSArray<NSString *> *)supportedEvents
|
285
290
|
{
|
286
|
-
|
291
|
+
return @[ @"onGestureHandlerEvent", @"onGestureHandlerStateChange" ];
|
287
292
|
}
|
288
293
|
|
289
294
|
#pragma mark Module Constants
|
290
295
|
|
291
296
|
- (NSDictionary *)constantsToExport
|
292
297
|
{
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
298
|
+
return @{
|
299
|
+
@"State" : @{
|
300
|
+
@"UNDETERMINED" : @(RNGestureHandlerStateUndetermined),
|
301
|
+
@"BEGAN" : @(RNGestureHandlerStateBegan),
|
302
|
+
@"ACTIVE" : @(RNGestureHandlerStateActive),
|
303
|
+
@"CANCELLED" : @(RNGestureHandlerStateCancelled),
|
304
|
+
@"FAILED" : @(RNGestureHandlerStateFailed),
|
305
|
+
@"END" : @(RNGestureHandlerStateEnd)
|
306
|
+
},
|
307
|
+
@"Direction" : @{
|
308
|
+
@"RIGHT" : @(RNGestureHandlerDirectionRight),
|
309
|
+
@"LEFT" : @(RNGestureHandlerDirectionLeft),
|
310
|
+
@"UP" : @(RNGestureHandlerDirectionUp),
|
311
|
+
@"DOWN" : @(RNGestureHandlerDirectionDown)
|
312
|
+
}
|
313
|
+
};
|
308
314
|
}
|
309
315
|
|
310
|
-
|
311
|
-
|
312
316
|
@end
|
@@ -13,7 +13,7 @@
|
|
13
13
|
@property (nonatomic) NSArray<NSDictionary *> *allPointersData;
|
14
14
|
@property (nonatomic) int trackedPointersCount;
|
15
15
|
|
16
|
-
- (id)initWithGestureHandler:(RNGestureHandler*)gestureHandler;
|
16
|
+
- (id)initWithGestureHandler:(RNGestureHandler *)gestureHandler;
|
17
17
|
|
18
18
|
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event;
|
19
19
|
- (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event;
|
@@ -15,11 +15,11 @@
|
|
15
15
|
_trackedPointersCount = 0;
|
16
16
|
_changedPointersData = nil;
|
17
17
|
_allPointersData = nil;
|
18
|
-
|
18
|
+
|
19
19
|
for (int i = 0; i < MAX_POINTERS_COUNT; i++) {
|
20
20
|
_trackedPointers[i] = nil;
|
21
21
|
}
|
22
|
-
|
22
|
+
|
23
23
|
return self;
|
24
24
|
}
|
25
25
|
|
@@ -31,7 +31,7 @@
|
|
31
31
|
return index;
|
32
32
|
}
|
33
33
|
}
|
34
|
-
|
34
|
+
|
35
35
|
return -1;
|
36
36
|
}
|
37
37
|
|
@@ -43,7 +43,7 @@
|
|
43
43
|
return index;
|
44
44
|
}
|
45
45
|
}
|
46
|
-
|
46
|
+
|
47
47
|
return -1;
|
48
48
|
}
|
49
49
|
|
@@ -68,32 +68,34 @@
|
|
68
68
|
return count;
|
69
69
|
}
|
70
70
|
|
71
|
-
- (NSDictionary *)extractPointerData:(int)index
|
72
|
-
forTouch:(UITouch *)touch
|
71
|
+
- (NSDictionary *)extractPointerData:(int)index forTouch:(UITouch *)touch
|
73
72
|
{
|
74
73
|
CGPoint relativePos = [touch locationInView:_gestureHandler.recognizer.view];
|
75
74
|
CGPoint absolutePos = [touch locationInView:_gestureHandler.recognizer.view.window];
|
76
|
-
|
77
|
-
return @{
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
75
|
+
|
76
|
+
return @{
|
77
|
+
@"id" : @(index),
|
78
|
+
@"x" : @(relativePos.x),
|
79
|
+
@"y" : @(relativePos.y),
|
80
|
+
@"absoluteX" : @(absolutePos.x),
|
81
|
+
@"absoluteY" : @(absolutePos.y)
|
82
|
+
};
|
82
83
|
}
|
83
84
|
|
84
|
-
- (void)extractAllTouches
|
85
|
+
- (void)extractAllTouches
|
86
|
+
{
|
85
87
|
int registeredTouches = [self registeredTouchesCount];
|
86
88
|
|
87
89
|
NSDictionary *data[registeredTouches];
|
88
90
|
int nextIndex = 0;
|
89
|
-
|
91
|
+
|
90
92
|
for (int i = 0; i < MAX_POINTERS_COUNT; i++) {
|
91
93
|
UITouch *touch = _trackedPointers[i];
|
92
94
|
if (touch != nil) {
|
93
95
|
data[nextIndex++] = [self extractPointerData:i forTouch:touch];
|
94
96
|
}
|
95
97
|
}
|
96
|
-
|
98
|
+
|
97
99
|
_allPointersData = [[NSArray alloc] initWithObjects:data count:registeredTouches];
|
98
100
|
}
|
99
101
|
|
@@ -102,11 +104,11 @@
|
|
102
104
|
if (!_gestureHandler.needsPointerData) {
|
103
105
|
return;
|
104
106
|
}
|
105
|
-
|
107
|
+
|
106
108
|
_eventType = RNGHTouchEventTypePointerDown;
|
107
|
-
|
109
|
+
|
108
110
|
NSDictionary *data[touches.count];
|
109
|
-
|
111
|
+
|
110
112
|
for (int i = 0; i < [touches count]; i++) {
|
111
113
|
UITouch *touch = [[touches allObjects] objectAtIndex:i];
|
112
114
|
int index = [self registerTouch:touch];
|
@@ -116,7 +118,7 @@
|
|
116
118
|
|
117
119
|
data[i] = [self extractPointerData:index forTouch:touch];
|
118
120
|
}
|
119
|
-
|
121
|
+
|
120
122
|
_changedPointersData = [[NSArray alloc] initWithObjects:data count:[touches count]];
|
121
123
|
// extract all touches last to include the ones that were just added
|
122
124
|
[self extractAllTouches];
|
@@ -128,17 +130,17 @@
|
|
128
130
|
if (!_gestureHandler.needsPointerData) {
|
129
131
|
return;
|
130
132
|
}
|
131
|
-
|
133
|
+
|
132
134
|
_eventType = RNGHTouchEventTypePointerMove;
|
133
|
-
|
135
|
+
|
134
136
|
NSDictionary *data[touches.count];
|
135
|
-
|
137
|
+
|
136
138
|
for (int i = 0; i < [touches count]; i++) {
|
137
139
|
UITouch *touch = [[touches allObjects] objectAtIndex:i];
|
138
140
|
int index = [self findTouchIndex:touch];
|
139
141
|
data[i] = [self extractPointerData:index forTouch:touch];
|
140
142
|
}
|
141
|
-
|
143
|
+
|
142
144
|
_changedPointersData = [[NSArray alloc] initWithObjects:data count:[touches count]];
|
143
145
|
[self extractAllTouches];
|
144
146
|
[self sendEvent];
|
@@ -149,14 +151,14 @@
|
|
149
151
|
if (!_gestureHandler.needsPointerData) {
|
150
152
|
return;
|
151
153
|
}
|
152
|
-
|
154
|
+
|
153
155
|
// extract all touches first to include the ones that were just lifted
|
154
156
|
[self extractAllTouches];
|
155
|
-
|
157
|
+
|
156
158
|
_eventType = RNGHTouchEventTypePointerUp;
|
157
|
-
|
159
|
+
|
158
160
|
NSDictionary *data[touches.count];
|
159
|
-
|
161
|
+
|
160
162
|
for (int i = 0; i < [touches count]; i++) {
|
161
163
|
UITouch *touch = [[touches allObjects] objectAtIndex:i];
|
162
164
|
int index = [self unregisterTouch:touch];
|
@@ -166,7 +168,7 @@
|
|
166
168
|
|
167
169
|
data[i] = [self extractPointerData:index forTouch:touch];
|
168
170
|
}
|
169
|
-
|
171
|
+
|
170
172
|
_changedPointersData = [[NSArray alloc] initWithObjects:data count:[touches count]];
|
171
173
|
[self sendEvent];
|
172
174
|
}
|
@@ -176,7 +178,7 @@
|
|
176
178
|
if (!_gestureHandler.needsPointerData) {
|
177
179
|
return;
|
178
180
|
}
|
179
|
-
|
181
|
+
|
180
182
|
[self reset];
|
181
183
|
}
|
182
184
|
|
@@ -185,7 +187,7 @@
|
|
185
187
|
if (!_gestureHandler.needsPointerData) {
|
186
188
|
return;
|
187
189
|
}
|
188
|
-
|
190
|
+
|
189
191
|
if (_trackedPointersCount == 0) {
|
190
192
|
// gesture has finished because all pointers were lifted, reset event type to send state change event
|
191
193
|
_eventType = RNGHTouchEventTypeUndetermined;
|
@@ -195,7 +197,7 @@
|
|
195
197
|
// we need to clear the pointers and send info about their cancellation
|
196
198
|
[self cancelPointers];
|
197
199
|
}
|
198
|
-
|
200
|
+
|
199
201
|
[_gestureHandler reset];
|
200
202
|
}
|
201
203
|
|
@@ -203,13 +205,13 @@
|
|
203
205
|
{
|
204
206
|
// extract all touches first to include the ones that were just cancelled
|
205
207
|
[self extractAllTouches];
|
206
|
-
|
208
|
+
|
207
209
|
int registeredTouches = [self registeredTouchesCount];
|
208
|
-
|
210
|
+
|
209
211
|
if (registeredTouches > 0) {
|
210
212
|
int nextIndex = 0;
|
211
213
|
NSDictionary *data[registeredTouches];
|
212
|
-
|
214
|
+
|
213
215
|
for (int i = 0; i < MAX_POINTERS_COUNT; i++) {
|
214
216
|
UITouch *touch = _trackedPointers[i];
|
215
217
|
if (touch != nil) {
|
@@ -217,7 +219,7 @@
|
|
217
219
|
[self unregisterTouch:touch];
|
218
220
|
}
|
219
221
|
}
|
220
|
-
|
222
|
+
|
221
223
|
_eventType = RNGHTouchEventTypeCancelled;
|
222
224
|
_changedPointersData = [[NSArray alloc] initWithObjects:data count:registeredTouches];
|
223
225
|
[self sendEvent];
|
@@ -233,8 +235,9 @@
|
|
233
235
|
if (!_gestureHandler.needsPointerData || _gestureHandler.recognizer.view.reactTag == nil) {
|
234
236
|
return;
|
235
237
|
}
|
236
|
-
|
237
|
-
[_gestureHandler sendTouchEventInState:[_gestureHandler state]
|
238
|
+
|
239
|
+
[_gestureHandler sendTouchEventInState:[_gestureHandler state]
|
240
|
+
forViewWithTag:_gestureHandler.recognizer.view.reactTag];
|
238
241
|
}
|
239
242
|
|
240
243
|
@end
|
@@ -12,7 +12,9 @@
|
|
12
12
|
|
13
13
|
- (nullable RNGestureHandler *)handlerWithTag:(nonnull NSNumber *)handlerTag;
|
14
14
|
- (void)registerGestureHandler:(nonnull RNGestureHandler *)gestureHandler;
|
15
|
-
- (void)attachHandlerWithTag:(nonnull NSNumber *)handlerTag
|
15
|
+
- (void)attachHandlerWithTag:(nonnull NSNumber *)handlerTag
|
16
|
+
toView:(nonnull UIView *)view
|
17
|
+
withActionType:(RNGestureHandlerActionType)actionType;
|
16
18
|
- (void)dropHandlerWithTag:(nonnull NSNumber *)handlerTag;
|
17
19
|
- (void)dropAllHandlers;
|
18
20
|
|