Android 圆圈进度

圆圈进度条控件

CircleProgressView

圆圈进度条、中间进度文字(可设置是否显示)

效果

1.圆帽 strokeCapRound=“true”
在这里插入图片描述

2.非圆帽子 strokeCapRound=“false”
在这里插入图片描述

资源

名字资源
AARcircle_progress_view.aar
GitHubCircleProgressView
GiteeCircleProgressView

Maven

1.build.grade | setting.grade

repositories {
	...
	maven { url 'https://jitpack.io' }
}

2./app/build.grade

dependencies {
	implementation 'com.github.RelinRan:CircleProgressView:2022.7.28.1'
}

xml

<androidx.widget.CircleProgressView
    android:id="@+id/circle_progress"
    android:layout_width="match_parent"
    android:layout_height="400dp"
    android:padding="20dp"
    app:progress="65"
    app:max="100"
    app:progressTextSize="20sp"
    app:strokeCapRound="true" />

attrs.xml

<!--进度值-->
<attr name="progress" format="integer" />
<!--进度最大值-->
<attr name="max" format="integer" />
<!--进度颜色-->
<attr name="progressColor" format="color" />
<!--进度文字-->
<attr name="progressTextVisibility" format="enum">
    <enum name="visible" value="0"></enum>
    <enum name="invisible" value="4"></enum>
</attr>
<!--进度文字-->
<attr name="progressTextSize" format="dimension" />
<!--进度文字颜色-->
<attr name="progressTextColor" format="color" />
<!--进度背景色-->
<attr name="progressBackgroundColor" format="color" />
<!--进度开始角度 0-360-->
<attr name="progressStartAngle" format="float" />
<!--圆圈线宽度-->
<attr name="progressStrokeWidth" format="dimension" />
<!--圆圈半径-->
<attr name="progressRadius" format="dimension" />
<!--是否帽圆-->
<attr name="strokeCapRound" format="boolean" />

使用

CircleProgressView circle_progress = findViewById(R.id.circle_progress);
circle_progress.setMax(100);
circle_progress.setProgress(65);
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值