androidandroid-animationandroid-drawableanimationdrawable

Android animate drawable


I'd like to display an animated drawable in my app.

Just to make the reader visualize what I have in mind, I need an air-conditioning unit that emits flows of air; the "power" of the flows should be adjustable.

It would be something like the animation of the Earth one can find in this app. Link to the animation.

I've found the AnimationDrawableclass here but this is a frame-by-frame animation, so I'd have to create lots of images.

I was woldering what would be the best way to create such an animation.

I apologize for the lack of specificity of this question but I don't know what to look for.


Solution

  • I ended up using a RotateAnimation because it was the easiest option to achieve what I wanted.

    To make the rotation smooth I followed what was suggested in this StackOverflow answer.