I have been trying to zoom in a view and then return back to the original size with a zoom out like animation.
What i have been able to do was put zoom in and out in a set and animate it on an imageview on button click, but it drops the image size suddenly for the first time, and then animates fine on the later clicks. I I would appreciate any help to accomplish a smooth animation
my code
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true"
>
<scale
android:duration="1000"
android:fromXScale="1"
android:fromYScale="1"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale=".5"
android:toYScale=".5" >
</scale>
<scale
android:duration="1000"
android:fromXScale=".5"
android:fromYScale=".5"
android:pivotX="50%"
android:pivotY="50%"
android:toXScale="1"
android:toYScale="1" >
</scale>
</set>
final Animation ani_in = AnimationUtils.loadAnimation(getApplicationContext(),R.anim.zoomin_out);
imageView.startAnimation(ani_in);