Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ NS_ASSUME_NONNULL_BEGIN

- (void)dispatchGestureEvent:(RNGestureHandlerDetectorEventEmitter::OnGestureHandlerEvent)event;

- (void)dispatchAnimatedGestureEvent:(RNGestureHandlerDetectorEventEmitter::OnGestureHandlerEvent)event;

- (void)dispatchTouchEvent:(RNGestureHandlerDetectorEventEmitter::OnGestureHandlerTouchEvent)event;

- (void)dispatchReanimatedStateChangeEvent:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,17 @@ - (void)dispatchGestureEvent:(RNGestureHandlerDetectorEventEmitter::OnGestureHan
}
}

- (void)dispatchAnimatedGestureEvent:(RNGestureHandlerDetectorEventEmitter::OnGestureHandlerEvent)event
{
if (_eventEmitter != nullptr) {
std::dynamic_pointer_cast<const RNGestureHandlerDetectorEventEmitter>(_eventEmitter)->onGestureHandlerAnimatedEvent({
.state = event.state,
.handlerTag = event.handlerTag,
.handlerData = event.handlerData,
});
}
}

- (void)dispatchTouchEvent:(RNGestureHandlerDetectorEventEmitter::OnGestureHandlerTouchEvent)event
{
if (_eventEmitter != nullptr) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -464,18 +464,21 @@ - (void)sendNativeOrVirtualEvent:(RNGestureHandlerStateChange *)event
forView:(RNGHUIView *)detectorView
{
if ([event isKindOfClass:[RNGestureHandlerEvent class]]) {
RNGestureHandlerEvent *gestureEvent = (RNGestureHandlerEvent *)event;

switch (eventHandlerType) {
case RNGestureHandlerEventHandlerTypeAnimated:
case RNGestureHandlerEventHandlerTypeAnimated: {
[self sendEventForNativeAnimatedEvent:event];
auto nativeEvent = [gestureEvent getNativeEvent];
[(RNGestureHandlerDetector *)detectorView dispatchAnimatedGestureEvent:nativeEvent];
break;
}
case RNGestureHandlerEventHandlerTypeReanimated: {
RNGestureHandlerEvent *gestureEvent = (RNGestureHandlerEvent *)event;
auto nativeEvent = [gestureEvent getReanimatedNativeEvent];
[(RNGestureHandlerDetector *)detectorView dispatchReanimatedGestureEvent:nativeEvent];
break;
}
case RNGestureHandlerEventHandlerTypeJS: {
RNGestureHandlerEvent *gestureEvent = (RNGestureHandlerEvent *)event;
auto nativeEvent = [gestureEvent getNativeEvent];
[(RNGestureHandlerDetector *)detectorView dispatchGestureEvent:nativeEvent];
break;
Expand Down
Loading