How to implement an Android dashboard

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.