安卓循环定时器

标签 android android-animation android-progressbar

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

enter image description here

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

最佳答案

要创建自定义组件,请检查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

关于安卓循环定时器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29236428/

相关文章:

Android Json 对象和 json 数组发送到 httppost

Android ViewPager CrossFade 动画

Android 4.4 进度对话框的全屏模式

java - 打开应用程序时是否会加载所有 .java 文件?

java - 无法在android中播放mpg文件

Android Jetpack 撰写 : Can't set backgroundColor for OutlinedTextField

android - 重复安卓动画

android - 微调器下拉动画

Android url下载计算进度?

android - 在android中创建矩形进度条