react-native-gesture-view
react-native-gesture-view copied to clipboard
Swipe detection for React Native
GestureView
Detects swipes in any <View>
element including the swipe direction.
Usage
You should use GestureView as a normal <View>
element:
render () {
return (
<GestureView onSwipeUp={this.onSwipeUp}>
<Text>Swipe up for awesomeness</Text>
</GestureView>
)
}
Props
-
onSwipeUp
an optional function that's triggered when the view detects a swipe to theup
direction -
onSwipeDown
an optional function that's triggered when the view detects a swipe to thedown
direction -
onSwipeLeft
an optional function that's triggered when the view detects a swipe to theleft
direction -
onSwipeRight
an optional function that's triggered when the view detects a swipe to theright
direction -
onUnhandleSwipe
an optional function that's triggered when the swipe was inside the threshold -
swipeThreshold
the amount of pixels that the swipe needs to have before being interpreted as a swipe. Defaults to120
-
quadrantThreshold
an angle that's computed into each quadrant, use it to make wider/narrowed quadrants. Defaults to30