Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Android, when swipe to change the screen how to show an animation with both screen

Sorry the title isn't clear enough. I don't know how to express it, but the image here says it all.

In the Google Reader App, if the uses swipe left or right on the current post, they will see the first post moves out as the second one moves in. It's a nice effect, but I have no clue how to implement it.

Any ideas?

enter image description here

like image 580
Xi 张熹 Avatar asked Nov 04 '22 00:11

Xi 张熹


1 Answers

You need to use a ViewPager with fragments:

http://android-developers.blogspot.co.uk/2011/08/horizontal-view-swiping-with-viewpager.html

like image 102
David Scott Avatar answered Nov 09 '22 11:11

David Scott