Skip to content

Commit

Permalink
fix Android onPress
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshu-satija committed Nov 16, 2016
1 parent 9387e05 commit bf705d6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Components/Widgets/DeckSwiper.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ export default class CardSwiper extends NativeBaseComponent {
componentWillMount() {
this._panResponder = PanResponder.create({
onMoveShouldSetResponderCapture: () => true,
onMoveShouldSetPanResponderCapture: () => true,
onMoveShouldSetPanResponderCapture: (evt, gestureState) => {
return Math.abs(gestureState.dx) > 5;
},

onPanResponderGrant: (e, gestureState) => {
this.state.pan.setOffset({x: this.state.pan.x._value, y: this.state.pan.y._value});
Expand All @@ -117,10 +119,10 @@ export default class CardSwiper extends NativeBaseComponent {

onPanResponderMove: (e, gestureState) => {
if (gestureState.dx > 20){
this.props.onSwiping('right');
this.props.onSwiping('right',gestureState.dx);
}
else if (gestureState.dx < -20){
this.props.onSwiping('left');
this.props.onSwiping('left',gestureState.dx);
}
let val = Math.abs((gestureState.dx*.0013));
let opa = Math.abs((gestureState.dx*.0022));
Expand Down

0 comments on commit bf705d6

Please sign in to comment.