Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Plus tile animation

I'm trying to figure out how I could make a similar layout as in Google plus timeline view. There's an animation while scrolling in timeline and I really like it. Any idea how to do that?

enter image description here

like image 900
Romain Piel Avatar asked Aug 24 '12 13:08

Romain Piel


2 Answers

You need to set a TranslateAnimation to the view and that would do the trick for you.

TranslateAnimation translateAnim = new TranslateAnimation(200, 0, 0, 0 );
//Use (0, 0, 200, 0 ) if you would like to animate this in a mobile device rather than a tab
listView.clearAnimation();
translateAnim.setDuration(500);   
translateAnim.setFillBefore(true);   
listView.startAnimation(translateAnim);

Hope this helps :)

like image 139
Jagadeesh Avatar answered Oct 05 '22 04:10

Jagadeesh


I would check out the carousel example code provide by google http://code.google.com/p/renderscript-examples/wiki/Carousel

Essentially what this does is creates a series of tiles that can be textured by any image you please. The code is set up out of the box to do a cylindrical carousel from the outside but you can move the view point and even make it flat as in the g+ example if you so chose.

A note of caution, as of Jellybean (4.1) Google has deprecated the graphics components of renderscript. We have begun the process of moving everything over from renderscript to openGL at our company, so be sure to evaluate if making new code with a deprecated API makes sense for you particular usage.

like image 23
Jared Avatar answered Oct 05 '22 05:10

Jared