davidisaaclee / react-native-gesture-handler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This fork adds an iOS-only TransformGestureHandler which implements a multitouch transform gesture, similar to Google Maps. This is different from the Pinch & rotate demo in the upstream repo in that TransformGestureHandler rotates and scales around the centroid of the touches – the effect is that, for a frame moving from touch locations (A, B) -> (A', B'), TransformGestureHandler reports a transform T such that A * T = A' and B * T = B'. See the Natural transform recipe in the example app for usage.

Update (January 2022): I recommend implementing this via RNGH's manual gestures for better compatibility.


React Native Gesture Handler by Software Mansion

Declarative API exposing platform native touch and gesture system to React Native.

React Native Gesture Handler provides native-driven gesture management APIs for building best possible touch-based experiences in React Native.

With this library gestures are no longer controlled by the JS responder system, but instead are recognized and tracked in the UI thread. It makes touch interactions and gesture tracking not only smooth, but also dependable and deterministic.

Installation

Check getting started section of our docs for the detailed installation instructions.

Documentation

Check out our dedicated documentation page for info about this library, API reference and more: https://docs.swmansion.com/react-native-gesture-handler/docs/

Examples

If you want to play with the API but don't feel like trying it on a real app, you can run the example project. Clone the repo, go to the examples/Example/ folder and run:

  yarn install

If you are running on ios, run pod install in the ios folder

Run yarn start to start the metro bundler

Run react-native run-android or react-native run-ios (depending on which platform you want to run the example app on).

You will need to have an Android or iOS device or emulator connected as well as react-native-cli package installed globally.

React native Support

version react-native version
1.4.0+ 0.60.0+
1.1.0+ 0.57.2+
<1.1.0 0.50.0+

It may be possible to use newer versions of react-native-gesture-handler on React Native with version <= 0.59 by reverse Jetifying. Read more on that here https://github.com/mikehardy/jetifier#to-reverse-jetify--convert-node_modules-dependencies-to-support-libraries

License

Gesture handler library is licensed under The MIT License.

Credits

This project is supported by amazing people from Expo.io and Software Mansion

expo swm

About

License:MIT License


Languages

Language:TypeScript 50.0%Language:Kotlin 23.3%Language:Objective-C 18.9%Language:JavaScript 2.6%Language:Swift 2.4%Language:Java 1.7%Language:Ruby 0.8%Language:Starlark 0.2%Language:HTML 0.1%Language:C 0.0%