0

How to add an animation which only occurs when the item is loaded first time like those in the Google+ app on Android?

Thanks!

shiami
  • 7,174
  • 16
  • 53
  • 68

2 Answers2

1

In the getView method of your Custom adapter, try adding the below animation to the convertView(list view item) and you should be able to do this..and its working for me

You need to set a TranslateAnimation to the view and that would do the trick for you.If you want this animation to occur only once then you need to update the array that is passed to the adapter with some key-value pair as "isAnimated":"true" after the animation happens at least once on the view item and the animation shouldn't be run if you have the item.isAnimated as true.

TranslateAnimation translateAnim = new TranslateAnimation(0, 0, 200, 0 );
listView.clearAnimation();
translateAnim.setDuration(500);   
translateAnim.setFillBefore(true);   
listView.startAnimation(translateAnim);

Hope this helps :)

Jagadeesh
  • 883
  • 1
  • 10
  • 26
0

You may be looking for something like this:

http://jsfiddle.net/zXBDd/2/

More info: Animate images in HTML5 mobile app (PhoneGap) like Google Plus iPhone app when scrolling down?

Community
  • 1
  • 1
Amulya Khare
  • 7,718
  • 2
  • 23
  • 38