Android – Rotate a view dynamically

androidanimationrotation

I have another question related to this disk: http://dl.dropbox.com/u/8051037/disk_ab1.png

I have created a custom view, and set everything up to rotate it, but I don't know how to set the rotation of the view when the disk is spinning. I think I could've done this with an Animation object and a TimeInterpolater, but I couldn't figure out how to use either of those, so I created my own little algorithm for doing it. The code I have can be found at:https://github.com/c0dege3k/StarkOMFGB/blob/master/Mods/LauncherDisk.java.

Thanks for ANY help, this and my other question for this disk have been giving me serious problems.

Best Solution

The easiest way will be to rotate the canvas than to draw the image and restore the canvas. For more info take a look here Rotating a view in Android