Android 循环定时器

Android Circular Timer

我想创建一个计时器,它将用特定的动画填充一个圆圈(圆环填充特定的颜色)。我想要达到的效果是这样的:

谁能告诉我怎样才能达到这种效果?

要创建自定义组件,请勾选Android API Guide。基本方法摘录:

  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.

用于创建循环进度条,

https://github.com/ylyc/circular_progress_bar 检查自定义库,这应该可以帮助您入门。

一些相关的SO链接,

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