webraptor / react-native-deck-swiper

tinder like react-native deck swiper
ISC License
126 stars 81 forks source link

[Help] Looking for help on inverting Vertical Swiping, Invert Animated.Value Y Axis. #38

Open spookyvert opened 3 years ago

spookyvert commented 3 years ago

Hey! Amazing package, it's been more than helpful for my current project

I've been trying to invert the Vertical Swiping feature on the Swiper.

I found that the swipe direction gets handled here so I'm pretty much trying to find out how to invert it value.

  createAnimatedEvent = () => {
    const { horizontalSwipe, verticalSwipe } = this.props
    const { x, y } = this.state.pan

    const dx = horizontalSwipe ? x : new Animated.Value(0)
    const dy = verticalSwipe ? y : new Animated.Value(0)

    return { dx, dy }
  }

If anyone has any knowledge on this it would be a lifesaver!!!