Could anyone tell me how they have got \'RotateDrawable\' to work whether it be from code or XML or both? The documentation on animating Drawables is pretty poor and animati
I would like to add a full example of animating a progress icon on ImageView, it is based on Mark Hetherington answer.
So my animation looks as follows:
icon comes from https://material.io/icons/
then my layout contains an ImageView as follows:
and finally in code when I need to show animation I do:
RotateDrawable rotateDrawable = ((RotateDrawable)progressImage.getBackground());
ObjectAnimator anim = ObjectAnimator.ofInt(rotateDrawable, "level", 0, 10000);
anim.setDuration(1000);
anim.setRepeatCount(ValueAnimator.INFINITE);
anim.start();