How to implement programatic swipe on click of a button for Tinder like app

837 views Asked by At

Hi i am using phillfarrugia/swipeable-view-stack for my tinder-like app.

I also want to implement left/right button that will serve the same purpose as left/right swipe (same as on tinder app), but that seems to be a bit of a problem.

Since the specific dragging mechanism (and math behind it) is what makes this cards move so uniquely and are managed by this guys repo, i guess it's not possible for me to manually manipulate the cards frame to the side on click of a button (at least not in the same way it's done with actual physical swipe).

That makes me conclude that the thing i should do is induce a fake swipe and let the already existing mechanism do it's magic and move the cards out of the screen in the natural fashion as if i've actually done it with my finger.

The problem is that i cannot find the way around it. I've followed https://stackoverflow.com/a/43211128/3634293 and attached these gesture recognizers to the topmost card and it didn't move at all.

Anyone have any idea?

0

There are 0 answers