How to get the current degree of RotateAnimation in Android? -


i have semi circle rotate 180 degrees. if user presses reset during rotateanimation, want have reset animation goes currentdegree 0. reset animation goes 180 0, looks strange if animation hasn't finished yet.

i have:

final rotateanimation resetanim =    new rotateanimation(-180f, 0f, width, height/2); 

i want like:

final rotateanimation resetanim =    new rotateanimation(currentdegreeofanimation, 0f, width, height/2); 

the speed of rotation is:

(enddegree - startdegree)/duration 

the total time has been rotating is:

currenttime - starttime 

and current degree is:

speed*time 

i believe have access of these variables through getters, except current time system.currenttimemillis(), don't forget keep units straight.


Comments