Google Plus tile animation

前端 未结 2 1307
广开言路
广开言路 2021-01-31 00:51

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

2条回答
  •  不知归路
    2021-01-31 01:24

    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 :)

提交回复
热议问题