CircularProgressLayout

public class CircularProgressLayout


CircularProgressLayout adds a circular countdown timer behind the view it contains, typically used to automatically confirm an operation after a short delay has elapsed.

The developer can specify a countdown interval via setTotalTime and a listener via setOnTimerFinishedListener to be called when the time has elapsed after startTimer has been called. Tap action can be received via setOnClickListener and can be used to cancel the timer via stopTimer method.

Alternatively, this layout can be used to show indeterminate progress by calling setIndeterminate method.

Summary

Nested types

CircularProgressLayout.OnTimerFinishedListener

Interface to implement for listening to onTimerFinished event.

Public constructors

CircularProgressLayout(
    Context context,
    AttributeSet attrs,
    int defStyleAttr
)
CircularProgressLayout(
    Context context,
    AttributeSet attrs,
    int defStyleAttr,
    int defStyleRes
)

Public methods

@ColorInt int

Returns the background color of the CircularProgressDrawable.

int[]

Returns the color scheme colors of the progress drawable

@Nullable CircularProgressLayout.OnTimerFinishedListener

Returns the OnTimerFinishedListener that is registered to this layout.

@NonNull CircularProgressDrawable

Returns the CircularProgressDrawable used as background of this layout.

float

Returns the starting rotation of the progress drawable.

float

Returns the stroke width of the progress drawable in pixels.

long

Returns the total time in milliseconds for the timer to countdown to.