HoverProcessView
YouTube:
Features
-
仿微信和微博的镂空半透明圆形进度
-
支持开启和关闭动画
-
背景支持圆角矩形
-
layout
<com.wuadam.hoverprocess.HoverProcessView
android:id="@+id/process"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:duration="1000"
app:hoverColor="#80000000"
app:max="100"
app:progress="30"
app:radius="48dp"
app:ringWidth="4dp"
app:roundCornerRadius="8dp" />
支持的 xml 属性
Attribute | format | describe | default |
---|---|---|---|
hoverColor | color | 背景和进度圆形的颜色 | #000000 |
radius | dimension | 进度圆形半径 | 50 px |
ringWidth | dimension | 背景和进度圆形之间的透明圆环宽度 | 5 px |
max | integer | 进度最大值 | 100 |
progress | integer | 初始进度 | 0 |
ringPadding | dimension | 透明圆环padding | 0 |
duration | integer | 进度圆形转满一圈所需的时间毫秒数 | 400 |
roundCornerRadius | dimension | 背景圆角半径 | 0 |
- java
HoverProcessView process = findViewById(R.id.process);
动画模式
process.setProgress(50, true);
无动画模式
process.setProgress(50, false);
无限模式
process.startInfiniteProgress();
process.stopInfiniteProgress();
onDestroy:
process.stop();