dashed-circular-progress——Android动画圆环进度条控件

dashed-circular-progress是一个可以放在任何视图内的Android动画圆环进度条控件。支持最小的SDK版本是11(Android 3.0 Honeycomb)。
 
自定义属性:
1、外部环的颜色:custom:external_color="#1affffff"
 
2、The color base of the progress bar:custom:base_color="#6effffff"
 
3、The color of the progress line:custom:progress_color="#000000"
 
4、进度条图标:custom:progress_icon="@drawable/my_awesome_icon"
 
5、进度条最大值:custom:max="999"
 
6、进度条最小值:custom:min="0"
 
7、动画持续时间:custom:duration="1000"
 
用法:

 

<com.github.glomadrian.dashedcircularprogress.DashedCircularProgress
  android:id="@+id/simple"
  android:layout_width="match_parent"
  android:layout_height="match_parent"  

  custom:external_color="#1affffff"
  custom:base_color="#6effffff"
  custom:min="0"
  custom:max="999"
  custom:progress_color="#000000"
  custom:progress_icon="@drawable/my_awesome_icon"
  custom:duration="3500"
>
  //Put here any view you like to be inside progress bar

</com.github.glomadrian.dashedcircularprogress.DashedCircularProgress>


刻度样式进度条的载入控件, 除了刻度进度条外,其他任何部分都可自定义。项目地址:https://github.com/glomadrian/dashed-circular-progress 效果图:如何使用:<com.github.glomadrian.dashedcircularprogress.DashedCircularProgress         android:layout_width="300dp"         android:layout_height="300dp">         //这里你可以添加任意View,他将显示在控件的中心位置     </com.github.glomadrian.dashedcircularprogress.DashedCircularProgress>比如:<com.github.glomadrian.dashedcircularprogress.DashedCircularProgress         android:id="@ id/progress"                 android:layout_centerInParent="true"         android:layout_width="300dp"         android:layout_height="300dp"         custom:min="0"         custom:max="100"         custom:duration="3500"         custom:progress_icon="@drawable/android">         <TextView android:id="@ id/text"                 android:textSize="25sp"                 android:layout_width="wrap_content"                 android:layout_height="wrap_content"                  android:text=""/>     </com.github.glomadrian.dashedcircularprogress.DashedCircularProgress>添加了一个用于显示进度的Textview。 你也可以添加ImageView等任何View。java代码:progress = (DashedCircularProgress)this.findViewById(R.id.progress); text = (TextView)this.findViewById(R.id.text); progress.setOnValueChangeListener( new DashedCircularProgress.OnValueChangeListener() {//监听进度值的变化,     @Override     public void onValueChange(float value) {         text.setText((int) value   "%");显示进度值     } }); progress.setValue(50);//设置当前的进度值为50。注意progress.setValue()设置的并不是进度的百分比。而要知道进度完成的百分比,你还需要设置progress.setMax(),progress.setMin() 即进度的最大值、最小值。属性说明:external_color  外圈圆环的颜色base_color    内圈(显示进度的)圆环颜色progress_color  内圈已完成部分的圆环颜色max   进度最大值min   进度最小值progress_icon  设置顶端的图标duration  进度改变时,需要多长时间的动画达到这个值
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值