I am using RotateAnimation
for image.
But I also want zoom on image with animation.
Means when my image is rotate then image is also zooming...
How can I do zoom with rotate animation?
I am using RotateAnimation
for image.
But I also want zoom on image with animation.
Means when my image is rotate then image is also zooming...
How can I do zoom with rotate animation?
I have one idea, hope it's help.
AnimationSet animSet = new AnimationSet(false);
RotateAnimation rotate = new RotateAnimation(0, 180);
ScaleAnimation zoom = new ScaleAnimation(0, 0, 1, 1);
animSet.addAnimation(rotate);
animSet.addAnimation(zoom);
animSet.start();
You should change parameters as need your application.
In anim xml, you can work with scale like this:
<scale
android:pivotX="50%"
android:pivotY="50%"
android:fromXScale=".1"
android:fromYScale=".1"
android:toXScale="1.0"
android:toYScale="1.0"
android:duration="2000" />
ScaleAnimation scal=new ScaleAnimation(0, 1f, 0, 1f, Animation.RELATIVE_TO_SELF, (float)0.5,Animation.RELATIVE_TO_SELF, (float)0.5);
scal.setDuration(500);
scal.setFillAfter(true);
((ImageView)findViewById(R.id.logo)).setAnimation(scal);