diff --git a/native/components/full-screen-view-modal.react.js b/native/components/full-screen-view-modal.react.js --- a/native/components/full-screen-view-modal.react.js +++ b/native/components/full-screen-view-modal.react.js @@ -17,6 +17,8 @@ type PinchGestureEvent, type PanGestureEvent, type TapGestureEvent, + GestureDetector, + Gesture, } from 'react-native-gesture-handler'; import Orientation from 'react-native-orientation-locker'; import Animated from 'react-native-reanimated'; @@ -165,6 +167,7 @@ +actionLinksEnabled: boolean, +updateCloseButtonEnabled: ([number]) => void, +updateActionLinksEnabled: ([number]) => void, + +gesture: ExclusiveGesture, }; class FullScreenViewModal extends React.PureComponent { @@ -1060,44 +1063,7 @@ ); return ( - - - - - - - - {view} - - - - - - - + {view} ); } @@ -1262,6 +1228,19 @@ [actionLinksEnabled], ); + const gesture = React.useMemo(() => { + const pinchGesture = Gesture.Pinch(); + const panGesture = Gesture.Pan().averageTouches(true); + const doubleTapGesture = Gesture.Tap().numberOfTaps(2); + const singleTapGesture = Gesture.Tap().numberOfTaps(1); + + return Gesture.Exclusive( + Gesture.Simultaneous(pinchGesture, panGesture), + doubleTapGesture, + singleTapGesture, + ); + }, []); + return ( ); }); diff --git a/native/flow-typed/npm/react-native-gesture-handler_v2.x.x.js b/native/flow-typed/npm/react-native-gesture-handler_v2.x.x.js --- a/native/flow-typed/npm/react-native-gesture-handler_v2.x.x.js +++ b/native/flow-typed/npm/react-native-gesture-handler_v2.x.x.js @@ -808,6 +808,10 @@ prepare(): void; } +declare class SimultaneousGesture extends ComposedGesture { + prepare(): void; +} + declare type UserSelect = 'none' | 'auto' | 'text'; interface GestureDetectorProps { @@ -816,12 +820,13 @@ children?: React$Node; } -declare const GestureObject: { - Tap: () => TapGesture, - Pan: () => PanGesture, - Pinch: () => PinchGesture, - Exclusive: (...gestures: Array) => ExclusiveGesture, -}; +declare const GestureObject: {| + +Tap: () => TapGesture, + +Pan: () => PanGesture, + +Pinch: () => PinchGesture, + +Exclusive: (...gestures: $ReadOnlyArray) => ExclusiveGesture, + +Simultaneous: (...gestures: $ReadOnlyArray) => SimultaneousGesture, +|}; declare module 'react-native-gesture-handler' { declare export { default as Swipeable } from 'react-native-gesture-handler/Swipeable';