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

How to swipe programmatically? #51

Closed
grigy opened this issue Nov 6, 2017 · 7 comments
Closed

How to swipe programmatically? #51

grigy opened this issue Nov 6, 2017 · 7 comments

Comments

@grigy
Copy link

grigy commented Nov 6, 2017

No description provided.

@grigy grigy changed the title How to programmatically swipe? How to swipe programmatically? Nov 8, 2017
@grigy grigy closed this as completed Nov 8, 2017
@richeterre
Copy link

@grigy, did you ever figure this out? Is it possible with this library?

@grigy
Copy link
Author

grigy commented Mar 12, 2018

@richeterre yes, something like this worked for me (props passed to the swipeable component):

rightActionReleaseAnimationFn={Animated.timing}
rightActionReleaseAnimationConfig={{
    toValue: {x: -maxWidth, y: 0},
    duration: 250,
    easing: Easing.elastic(0.5)
}}

@richeterre
Copy link

@grigy: Ah, you mean for animating the Swipeable as a consequence of the user swiping, such as in a "hide to swipe card" scenario. While that's super useful too, what I meant was more something like showing the user a demo of how to swipe when the component first mounts, without any required user interaction. But I figured it out by simply wrapping the Swipeable in an Animated.View and animating that one using RN's own animation API.

@freshedgarT
Copy link

@grigy I tried your approach, but couldn't get it to work.
Could you elaborate on how you were able to swipe programmatically?
Just to clarify what I mean by swipe programmatically: I want to press a button and Swipeable opens rightButtons just as if I had swiped.

@grigy
Copy link
Author

grigy commented May 28, 2018

Hi, I understand that the title may be confusing and this may not be what you want. But it doesn't start swiping programmatically, which is still triggered by user. It just continues swiping by using animation. Sorry for confusion.

@sergey-kozel
Copy link

See #78

@jeronnex2
Copy link

is this possible? I want to put a button in my swipeable and when it is clicked it will automatically swipe left and see other 2 buttons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants