Search code examples
androidandroid-layoutviewflipperandroid-sliding

Slide between layouts without swiping or gesture in Android


I'm using view flipper to make the user to be able to slide between layouts by clicking to related button, But the thing is, I have around 10 different layouts and some of them are quite complex. So I get "Out of Memory" Error.

I searched something on the internet and what I see is ,swiping between layouts with gestures. And What I want is just to be able to slide between two layouts with "slide in" and "slide out" animations. NOT with GESTURES and SWIPING, by just clicking the button. It will be like a new activity starts but I just want to slide between layouts. Thanks is advance !


Solution

  • Fragments! Dynamically build, show, hide and destroy them. And use XML animations to do whatever animation you want for transition.