Zooming Animation in android
Here I am writing a code for zoom animation.
Here I have add this animation on mic button. You can add it according to your requirements.
First of all implements Animation.AnimationListener listener.
Then in your activity do this
Animation animZoomIn;
animZoomIn = AnimationUtils.loadAnimation(this, R.anim.zoom_in);
animZoomIn.setAnimationListener(this);
You have to specify your animation in an xml. This is the zoom_in.xml in anim folder in res file.
<scale
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="1000"
android:fromXScale="1"
android:fromYScale="1"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="1.5"
android:repeatCount="infinite"
android:repeatMode="restart"
android:toYScale="1.5" >
</scale>
click of an image or any event, you can start animation like this.
micImage.startAnimation(animZoomIn);
When you want to close animation for this image you just have to call
micImage.clearAnimation();
0 Comment(s)