react-native-gesture-view
v0.2.1
Published
A View component with swipe gestures
Downloads
206
Readme
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
directiononSwipeDown
an optional function that's triggered when the view detects a swipe to thedown
directiononSwipeLeft
an optional function that's triggered when the view detects a swipe to theleft
directiononSwipeRight
an optional function that's triggered when the view detects a swipe to theright
directiononUnhandleSwipe
an optional function that's triggered when the swipe was inside the thresholdswipeThreshold
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