ArcProgressView¶
Quick start¶
<com.ave.vastgui.tools.view.progress.ArcProgressView
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
Progress width¶
Width of pogress can be set by arc_progress_width
or calling mProgressWidth
.
mBinding.arcProgressView.mProgressWidth = 10f.DP
<com.ave.vastgui.tools.view.progress.ArcProgressView
...
app:arc_progress_width="10dp" />
20dp | 10dp |
---|---|
Color of startpoint and endpoint circle¶
Color of startpoint circle can be set by arc_progress_startpoint_circle_color
or calling mStartpointCircleColor
.
Color of endpoint circle can be set by arc_progress_endpoint_circle_color
or calling mEndpointCircleColor
.
mBinding.arcProgressView.mStartpointCircleColor =
ColorUtils.colorHex2Int("#e84118")
mBinding.arcProgressView.mEndpointCircleColor =
ColorUtils.colorHex2Int("#e84118")
<com.ave.vastgui.tools.view.progress.ArcProgressView
...
app:arc_progress_startpoint_circle_color="#e84118"
app:arc_progress_endpoint_circle_color="#e84118" />
Progress 0 | Progress 55 | Startpoint circle | Endpoint circle |
---|---|---|---|
Radius of endpoint circle¶
Radius of endpoint circle can be set by arc_progress_endpoint_circle_radius
or calling mEndpointCircleRadius
.
mBinding.arcProgressView.mEndpointCircleRadius =
15f.DP.coerceAtLeast(recommendedRadius())
<com.ave.vastgui.tools.view.progress.ArcProgressView
...
app:arc_progress_endpoint_circle_radius="20dp" />
Shader¶
Shader of progress can be set by calling mProgressShader
.
val colors = intArrayOf(
... // Color-int
)
val pos = floatArrayOf(
... // The relative positions [0..1] of each corresponding color in the colors array.
)
getBinding().arcProgressView.mProgressShader = LinearGradient(
-700f, 0f, 700f, 0f,
colors, pos,
Shader.TileMode.CLAMP
)