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 @@ -673,6 +673,9 @@ success: boolean, ) => void, ): this; + initialize(): void; + toGestureArray(): Array; + prepare(): void; } declare type TapGestureHandlerEventPayload = { @@ -801,6 +804,10 @@ toGestureArray(): Array; } +declare class ExclusiveGesture extends ComposedGesture { + prepare(): void; +} + declare type UserSelect = 'none' | 'auto' | 'text'; interface GestureDetectorProps { @@ -813,6 +820,7 @@ Tap: () => TapGesture, Pan: () => PanGesture, Pinch: () => PinchGesture, + Exclusive: (...gestures: Array) => ExclusiveGesture, }; declare module 'react-native-gesture-handler' { diff --git a/native/media/camera-modal.react.js b/native/media/camera-modal.react.js --- a/native/media/camera-modal.react.js +++ b/native/media/camera-modal.react.js @@ -21,6 +21,8 @@ State as GestureState, type PinchGestureEvent, type TapGestureEvent, + Gesture, + GestureDetector, } from 'react-native-gesture-handler'; import Orientation from 'react-native-orientation-locker'; import type { Orientations } from 'react-native-orientation-locker'; @@ -285,6 +287,7 @@ +close: () => void, +sendPhoto: () => Promise, +clearPendingImage: () => void, + +gesture: ExclusiveGesture, }; class CameraModal extends React.PureComponent { @@ -694,44 +697,30 @@ } return ( - + - + - - - - {flashIcon} - - - - - - {switchCameraButton} - - - + {flashIcon} + + + + + + {switchCameraButton} + - + ); } @@ -1220,6 +1209,13 @@ setPendingPhotoCapture(); }, []); + const gesture = React.useMemo(() => { + // TODO: we'll use this in the next diffs + const pinchGesture = Gesture.Pinch().onUpdate((/* { scale } */) => {}); + const tapGesture = Gesture.Tap().onStart((/* { x, y } */) => {}); + return Gesture.Exclusive(pinchGesture, tapGesture); + }, []); + return ( ); });