在android上显示圆形进度条(实心圆圈) [英] Show Circular progress bar on android (filled circle)

查看:71
本文介绍了在android上显示圆形进度条(实心圆圈)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在android上显示一个填充的圆形进度条?

进度条应该像圆而不是圆一样填充,并且应该具有可自定义的功能,例如动画计时动画插值器等.

解决方案

该项目有助于在 android 5 (lolipop) 及更高版本上显示一个简单的填充圆形进度条.它是高度可定制的,所有自定义属性都显示在下面的代码示例中.

这是一个开源项目,您可以随意查看代码或克隆它并根据您的要求对其进行修改.

How to show a filled circular progress bar on android?

The progress bar should be filled like a circle not like a ring and it should have customizable features like animation timings animation interpolators etc.

解决方案

This project helps display a simple filled circular progress bar on android 5 (lolipop) and above. It is extremely customizable all the custom attributes are shown in the code sample below.

This is an open source project, feel free to look into code or clone it and modify it per your requirements.

Follow the GitHub instructions to get started

<com.jeet.circularprogressbar.CircularProgressBar
       android:id="@+id/customRoundProgressBar"
       android:layout_width="100dp"
       android:layout_height="100dp"
       app:layout_constraintBottom_toBottomOf="parent"
       app:layout_constraintLeft_toLeftOf="parent"
       app:layout_constraintRight_toRightOf="parent"
       app:layout_constraintTop_toTopOf="parent"
       app:maxProgressLimit="60"
       app:progress="50"
       app:maxAnimationDuration="2500"
       app:animationInterpolator="AccelerateDecelerateInterpolator"
       app:showProgressText="true"
       app:progressTextSize="16sp"
       app:progressTextColor="@color/black"
       app:progressBarColor="@android:color/holo_red_dark" />

  • Max progress limit by default is 100 and min progress limit by default is 0, none of the parameters are required other than width and height.
  • You can play with different interpolators to animate the progress values, **default is acceleratedecelateinterpolator**
  • The maximum Animation Duration can also be changed.
  • All the properties shown in xml can be changed from code as well
  • For example:

    setProgress(progressValue) can be called from code to set the current progress of the progress bar.

  • Result

    这篇关于在android上显示圆形进度条(实心圆圈)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆