Recently a little time want to tidy up, some of their own small animation, share out.
First look at the effect
From the overall point of view, the effect is pretty good, the scale is still quite accurate.
And then say the idea:
In fact, this animation is a pretty simple little animation, the whole effect only with a rotateanimation rotation animation.
The main difference is how many ticks to rotate and how much to rotate between each scale and scale.
Because this figure of mine is a standard semicircle, in fact from the scale 0---"tick 10000 is a 180 of the boxer." Each tick is calculated as a 200 score.
So we just have to test out a scale and it needs to be rotated to what angle it is.
For example, a scale is rotated from 0 to 10.
Then a scale is the angle of 10. 10/200=0.05, then means a score =0.05 angle, and then according to the overall score *0.05, is the angle of rotation.
Then we can do a simple animation of rotation.
It's that simple.
Of course, according to the different needs of the UI designer, the effect of the request is different, the effect of the image is different, then sometimes every tick may not be so accurate.
For example, the 0--1000 score, the angle may be 10. The angle of 1000-2000 may be 15.
Then we need to test each scale separately to record the angle, and then a simple animation can be.
This needs to be modified according to the actual situation.
This is the simplest way to achieve, and the effect is very good.
Source Address:
http://download.csdn.net/detail/sit820/8917815
How to implement an Android dashboard