Skip to content

ArcProgressView

Version 0.2.0

Quick start

Version 0.2.0

<com.ave.vastgui.tools.view.progress.ArcProgressView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"/>

Default style

Progress width

Version 0.2.0

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
Width 20dp Width 10dp

Color of startpoint and endpoint circle

Version 0.5.4

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
Progress 0 Progress 55 Startpoint circle Endpoint circle

Radius of endpoint circle

Version 0.5.5

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" />

Progress endpoint radius

Shader

Version 0.2.0

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
)

Progress shader

Sample code

Sample code