Android. Swipe back like Telegram

How to scroll through previous activity using gestures and animations, for example, in the Telegram and Tinder app?

+3


source to share


2 answers


Telegram uses its own created snippets. They created a class called ActionBarLayout, which is basically a FrameLayout and added to the main activity, and the fragment is just a view class (TelegramFragment) that is added to the ActionBarLayout (they are stored in a list and are much faster than regular fragments (with slightly less capabilities ).

To animate, they just animate the added look.



You can see how the classes work in action HERE and HERE

+4


source


there is a nice library on github where I contributed: it handles this function with both actions and fragments.



https://github.com/r0adkll/Slidr

+1


source







All Articles