2

I am trying to animate my Cart Icon on the Action Bar when clicking on Add Item. As the animation, I want to zoom-in the Cart icon a little, and then zoom-out back to the original size. How can I do it?

jetty
  • 859
  • 2
  • 17
  • 37
  • Can you use `Toolbar` instead? If yes, you can set a custom view that contains an `ImageView` and apply scale animation this way: http://stackoverflow.com/questions/11422421/android-image-view-scale-animation – Gennadii Saprykin Aug 08 '15 at 08:11
  • I have added the Cart as a menu item on Action Bar. Do not know how to move it to a custom view. :( – jetty Aug 08 '15 at 08:22

2 Answers2

5

you can try this :

 ScaleAnimation scale = new ScaleAnimation(0, 1, 0, 1, ScaleAnimation.RELATIVE_TO_SELF, .5f, ScaleAnimation.RELATIVE_TO_SELF, .5f);
                scale.setDuration(500);
                scale.setInterpolator(new OvershootInterpolator());
               yourCartIcon.startAnimation(scale);
Rustam
  • 6,485
  • 1
  • 25
  • 25
1

you can check here its it has almost similar which you have required

Check link here

enter image description here

Community
  • 1
  • 1
satvinder singh
  • 1,152
  • 1
  • 12
  • 22