Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android rotate clockwise over then rotate aniclockwise back on its own axis

How to rotate imageview clockwise 10degree ,

then the imageview animation stop (at 10degree) rotate back(aniclockwise) to 0 degree in repeate?

I just know how to rotate to 10 degree, but I don't know how to return back to 0 degree.

Thank you very much.

imageview 0 degree → 10 degree → 0 degree ( repeat)

   RotateAnimation anim = new RotateAnimation(x, y, 10f, 10f);
    anim.setInterpolator(new LinearInterpolator());
    anim.setRepeatCount(Animation.INFINITE);
    anim.setDuration(700);
    imageView.startAnimation(anim);
like image 564
dickfala Avatar asked Dec 03 '25 14:12

dickfala


1 Answers

You have to set the repeat mode of animation.

anim.setRepeatMode(Animation.REVERSE);
like image 153
Shadab Mirza Avatar answered Dec 05 '25 08:12

Shadab Mirza



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!