Android 自定义圆形进度条,包括传统传统的圆形(CircleProgress)、刻度(DialProgress)、水波纹(WaveProgress)效果的三种圆形进度条。
效果图如下:
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add the dependency:
dependencies {
compile 'com.github.LiuZhiPeng1214:CircleProgress:0.0.1-beta'
}
关于 XML 的配置请见 circleprogress module 下的 attrs.xml 文件
key | value | description |
---|---|---|
showUnitPosition | right , below | 设置单位的显示模式 |
antiAlias | boolean | 是否开启抗锯齿 |
startAngle | float | 圆弧起始角度,3点钟方向为0,顺时针递增,小于0或大于360进行取余 |
sweepAngle | float | 圆弧度数 |
animTime | integer | 设置动画时间 |
maxValue | float | 绘制内容数值 |
value | float | 绘制内容数值 |
hint | string,reference | 内容提示语 |
hintSize | dimension | 提示语字体大小 |
hintColor | color,reference | 提示语字体颜色 |
unit | String,reference | 单位 |
unitSize | dimension | 单位字体大小 |
unitColor | color,reference | 单位颜色 |
precision | integer | 精度,默认为0 |
valueSize | dimension | 值的字体大小 |
valueColor | color,reference | 值的颜色 |
arcColor1,arcColor2,arcColor3 | color,reference | 圆弧颜色,设置多个可实现渐变 |
baArcColor | color,reference | 背景圆弧颜色 |
arcWidth | dimension | 圆弧宽度 |
arcColors | color,reference | 圆弧颜色 |
textOffsetPercentInRadius | float | 文字的偏移量。相对于圆半径而言,默认三分之一 |