RNGH2 finally brings one of the most requested features: manual gestures and touch events. To demonstrate how to make a manual gesture we will make a simple one that tracks all pointers on the screen.
And that's all! As you can see using manual gestures is really easy but as you can imagine, manual gestures are a powerful tool that makes it possible to accomplish things that were previously impossible with RNGH.
Modifying existing gestures
While manual gestures open great possibilities we are aware that reimplementing pinch or rotation from scratch just because you need to activate in specific circumstances or require position of the fingers, would be a waste of time as those gestures are already there. Because of that you can use touch events with every gesture so that you can extract more informations about gesture than is sent to you in events. We also added a
manualActivation modifier on all continous gestures, which prevents the gesture it is applied to from activating by itself thus giving you full control of its behavior.
This functionality makes another highly requested feature possible: drag after long press. Simply set
true on a
PanGesture and use
StateManager to fail the gesture if the user attempts to drag the component sooner than the duration of the long press.