Skip to content

Commit 5c24151

Browse files
committed
removed logic events web/android
1 parent 7fb8ea9 commit 5c24151

File tree

9 files changed

+53
-319
lines changed

9 files changed

+53
-319
lines changed

packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerEventDispatcher.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class RNGestureHandlerEventDispatcher(private val reactApplicationContext: React
153153
}
154154

155155
GestureHandler.ACTION_TYPE_LOGIC_DETECTOR -> {
156-
val event = RNGestureHandlerLogicStateChangeEvent.obtain(
156+
val event = RNGestureHandlerStateChangeEvent.obtain(
157157
handler,
158158
newState,
159159
oldState,
@@ -198,7 +198,7 @@ class RNGestureHandlerEventDispatcher(private val reactApplicationContext: React
198198
handler.viewForEvents!!.dispatchEvent(event)
199199
}
200200
GestureHandler.ACTION_TYPE_LOGIC_DETECTOR -> {
201-
val event = RNGestureHandlerLogicTouchEvent.obtain(handler, handler.actionType)
201+
val event = RNGestureHandlerTouchEvent.obtain(handler, handler.actionType)
202202

203203
handler.parentView?.dispatchEvent(event)
204204
}

packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerLogicEvent.kt

Lines changed: 0 additions & 76 deletions
This file was deleted.

packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerLogicStateChangeEvent.kt

Lines changed: 0 additions & 99 deletions
This file was deleted.

packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerLogicTouchEvent.kt

Lines changed: 0 additions & 77 deletions
This file was deleted.

packages/react-native-gesture-handler/src/specs/RNGestureHandlerDetectorNativeComponent.ts

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,13 @@ type GestureHandlerEvent = Readonly<{
1313
handlerData: UnsafeMixed;
1414
}>;
1515

16-
type GestureHandlerLogicEvent = Readonly<{
17-
handlerTag: Int32;
18-
state: Int32;
19-
handlerData: UnsafeMixed;
20-
childTag: Int32;
21-
}>;
22-
2316
type GestureHandlerStateChangeEvent = Readonly<{
2417
handlerTag: Int32;
2518
state: Int32;
2619
oldState: Int32;
2720
handlerData: UnsafeMixed;
2821
}>;
2922

30-
type GestureHandlerLogicStateChangeEvent = Readonly<{
31-
handlerTag: Int32;
32-
state: Int32;
33-
oldState: Int32;
34-
handlerData: UnsafeMixed;
35-
childTag: Int32;
36-
}>;
37-
3823
type GestureHandlerTouchEvent = Readonly<{
3924
handlerTag: Int32;
4025
numberOfTouches: Int32;
@@ -57,29 +42,6 @@ type GestureHandlerTouchEvent = Readonly<{
5742
pointerType: Int32;
5843
}>;
5944

60-
type GestureHandlerLogicTouchEvent = Readonly<{
61-
handlerTag: Int32;
62-
numberOfTouches: Int32;
63-
state: Int32;
64-
eventType: Int32;
65-
allTouches: {
66-
id: Int32;
67-
x: Double;
68-
y: Double;
69-
absoluteX: Double;
70-
absoluteY: Double;
71-
}[];
72-
changedTouches: {
73-
id: Int32;
74-
x: Double;
75-
y: Double;
76-
absoluteX: Double;
77-
absoluteY: Double;
78-
}[];
79-
pointerType: Int32;
80-
childTag: Int32;
81-
}>;
82-
8345
export interface LogicProps {
8446
handlerTags: Int32[];
8547
moduleId: Int32;
@@ -92,9 +54,9 @@ export interface NativeProps extends ViewProps {
9254
onGestureHandlerStateChange?: DirectEventHandler<GestureHandlerStateChangeEvent>;
9355
onGestureHandlerTouchEvent?: DirectEventHandler<GestureHandlerTouchEvent>;
9456

95-
onGestureHandlerLogicEvent?: DirectEventHandler<GestureHandlerLogicEvent>;
96-
onGestureHandlerLogicStateChange?: DirectEventHandler<GestureHandlerLogicStateChangeEvent>;
97-
onGestureHandlerLogicTouchEvent?: DirectEventHandler<GestureHandlerLogicTouchEvent>;
57+
onGestureHandlerLogicEvent?: DirectEventHandler<GestureHandlerEvent>;
58+
onGestureHandlerLogicStateChange?: DirectEventHandler<GestureHandlerStateChangeEvent>;
59+
onGestureHandlerLogicTouchEvent?: DirectEventHandler<GestureHandlerTouchEvent>;
9860

9961
handlerTags: Int32[];
10062
moduleId: Int32;

packages/react-native-gesture-handler/src/v3/HostGestureDetector.web.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const HostGestureDetector = (props: GestureHandlerDetectorProps) => {
5252
currentHandlerTags: Set<number>,
5353
attachedHandlerTags: Set<number>,
5454
attachedNativeHandlerTags: Set<number>,
55-
childTag?: number
55+
isLogic: boolean
5656
) => {
5757
const oldHandlerTags = attachedHandlerTags.difference(currentHandlerTags);
5858
const newHandlerTags = currentHandlerTags.difference(attachedHandlerTags);
@@ -79,9 +79,8 @@ const HostGestureDetector = (props: GestureHandlerDetectorProps) => {
7979
RNGestureHandlerModule.attachGestureHandler(
8080
tag,
8181
viewRef.current,
82-
childTag ? ActionType.LogicDetector : ActionType.NATIVE_DETECTOR,
83-
propsRef,
84-
childTag
82+
isLogic ? ActionType.LogicDetector : ActionType.NATIVE_DETECTOR,
83+
propsRef
8584
);
8685
}
8786
attachedHandlerTags.add(tag);
@@ -108,7 +107,8 @@ const HostGestureDetector = (props: GestureHandlerDetectorProps) => {
108107
propsRef,
109108
new Set(handlerTags),
110109
attachedHandlerTags.current,
111-
attachedNativeHandlerTags.current
110+
attachedNativeHandlerTags.current,
111+
false
112112
);
113113
}, [handlerTags, children]);
114114

@@ -140,7 +140,7 @@ const HostGestureDetector = (props: GestureHandlerDetectorProps) => {
140140
new Set(child.handlerTags),
141141
attachedHandlerTags,
142142
attachedNativeHandlerTags,
143-
child.viewTag
143+
true
144144
);
145145
}
146146
});

0 commit comments

Comments
 (0)