📄️ Gesture detector
GestureDetector is the main component of the RNGH2. It is responsible for creating and updating native gesture handlers based on the config of provided gesture. The most significant difference between it and old gesture handlers is that the GestureDetector can recognize more than one gesture at the time thanks to gesture composition. Keep in mind that GestureDetector is not compatible with the Animated API, nor with Reanimated 1.
Gesture is the object that allows you to create and compose gestures.
📄️ Pan gesture
A continuous gesture that can recognize a panning (dragging) gesture and track its movement.
📄️ Tap gesture
A discrete gesture that recognizes one or many taps.
📄️ Long press gesture
A discrete gesture that activates when the corresponding view is pressed for a sufficiently long time.
📄️ Rotation gesture
A continuous gesture that can recognize a rotation gesture and track its movement.
📄️ Pinch gesture
A continuous gesture that recognizes pinch gesture. It allows for tracking the distance between two fingers and use that information to scale or zoom your content.
📄️ Fling gesture
A discrete gesture that activates when the movement is sufficiently long and fast.
📄️ Hover gesture
A continuous gesture that can recognize hovering above the view it's attached to. The hover effect may be activated by moving a mouse or a stylus over the view.
📄️ Force touch gesture
A continuous gesture that recognizes force of a touch. It allows for tracking pressure of touch on some iOS devices.
📄️ Native gesture
A gesture that allows other touch handling components to participate in RNGH's gesture system. When used, the other component should be the direct child of a GestureDetector.
📄️ Manual gesture
A plain gesture that has no specific activation criteria nor event data set. Its state has to be controlled manually using a state manager. It will not fail when all the pointers are lifted from the screen.
📄️ Composed gestures
Composed gestures (Race, Simultaneous, Exclusive) provide a simple way of building relations between gestures.
📄️ Touch events
Touch event attributes:
📄️ Gesture state manager
GestureStateManager allows to manually control the state of the gestures. Please note that react-native-reanimated is required to use it, since it allows for synchronously executing methods in worklets.