How can I implement an animation in Android Studio where a circle "closes" in a specific interval (30 seconds) like that and repeat itself?
Asked
Active
Viewed 1,443 times
0
-
1there are exact libraries available.just search for it. – Anirudh Sharma Jul 22 '15 at 07:11
-
1Your answer is here. http://stackoverflow.com/questions/29381474/how-to-draw-a-circle-with-animation-in-android – Nauman Ash Jul 22 '15 at 07:47
1 Answers
2
If you want to do it yourself (It's quite fun) then here's what you need:
Create a custom view, in the onDraw(Canva canvas) method, you need to:
- draw a grey circle, centered in your view.
- draw a blue arc, it's angle being a percentage of 360 describing the percentage of time which has happened (this should be backed by a timing mechanism)
- draw a light blue circle (same colour as the parent) with the same center as both above.
- Either draw text (or, can be slightly easier, create a child TextView and layer it ontop).
The code for all of those things is pretty easy to find on SO.
Good luck!

Graeme
- 25,714
- 24
- 124
- 186