Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify Flip Direction #13

Open
aprct opened this issue Jul 12, 2016 · 4 comments
Open

Specify Flip Direction #13

aprct opened this issue Jul 12, 2016 · 4 comments
Assignees

Comments

@aprct
Copy link

aprct commented Jul 12, 2016

Love the component!

Currently the card flips to the right, then flips back to the left.

It would be extremely useful for my project (and many others, I'm sure) if we could specify which direction to flip based on which direction the user swiped.

I already have the swipe detection working and now all we need is the card flip direction implemented.

Thanks!

@moschan
Copy link
Owner

moschan commented Jul 15, 2016

@aprct
Thank you for your issue.
I will check and reply soon.

@aprct
Copy link
Author

aprct commented Aug 29, 2016

Hey @moschan, any luck?

Also, what are your thoughts on adding a third-party dependency?

@moschan
Copy link
Owner

moschan commented Aug 30, 2016

@aprct Hi, sorry I've been tied up with work.. 😱

Also, what are your thoughts on adding a third-party dependency?

That depends on the situation. But I think, our component should be simple. So I don't want to inject other untrusted/unstable dependencies.

What do you think about that and why do you ask❓

Thanks.

@aprct
Copy link
Author

aprct commented Aug 30, 2016

No problem! Me too. :)

I was just curious about what kind of solution you'd be interested in to detect the direction of a swipe.

The current implementation responds correctly to a right-swipe. To get the horizontal left-swipe to animate correctly, for example, we just need to push these transforms instead:

transform.push({ scaleX: -1 });

transform.push({
  rotateY: this.state.rotate.interpolate({
    inputRange: [0, 1],
    outputRange: [ '-180deg', '0deg' ]
  })
});

What's missing now is a way to detect the direction of the swipe. We can use native PanResponder (which adds a great deal of code), or we can use something else to detect the direction of the swipe.

Thoughts?

@juandl juandl self-assigned this Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants