osayilgan
osayilgan

Reputation: 5893

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 !

Upvotes: 0

Views: 453

Answers (2)

Michell Bak
Michell Bak

Reputation: 13252

Use the ViewPager with Fragments, both of which can be found in the support library and are compatible all the way down to Android 1.6.

Upvotes: 1

Budius
Budius

Reputation: 39846

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

Upvotes: 2

Related Questions