Reputation: 323
I am trying to apply Animation to a button. What I want to do is when I press a button depending on the pressure I put, the button should scale down or up accordingly. If I release, it should come back to its original size. How do I do it?
Upvotes: 0
Views: 603
Reputation: 1106
You can use this code for scale animation
ScaleAnimation animation = new ScaleAnimation(fromXscale, toXscale, fromYscale, toYscale, Animation.RELATIVE_TO_SELF, (float)0.5, Animation.RELATIVE_TO_SELF, (float)0.5);
For more Information: http://developer.android.com/reference/android/view/animation/ScaleAnimation.html
Upvotes: 2