Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Circular Timer

I want to create a timer that will fill a circle with a certain animation (the ring fills in with a specific color). The effect I want to achieve is this:

enter image description here

Can someone tell me how can I achieve this effect?

like image 702
Darko Petkovski Avatar asked Feb 17 '26 10:02

Darko Petkovski


1 Answers

For creating custom components, please check Android API Guide. Excerpt for Basic Approach:

  1. Extend an existing View class or subclass with your own class.
  2. Override some of the methods from the superclass. The superclass methods to override start with 'on', for example, onDraw(), onMeasure(), and onKeyDown(). This is similar to the on... events in Activity or ListActivity that you override for lifecycle and other functionality hooks.
  3. Use your new extension class. Once completed, your new extension class can be used in place of the view upon which it was based.

For create circular progress bar,

check custom library at https://github.com/ylyc/circular_progress_bar, this should get you started.

Some related SO links,

Android Countdown Timer Circular Progress Bar doesn't match with timer

like image 109
Ranjithkumar Avatar answered Feb 18 '26 22:02

Ranjithkumar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!