added in version 26.1.0
belongs to Maven artifact


public class CircularProgressDrawable
extends Drawable implements Animatable


Drawable that renders the animated indeterminate progress indicator in the Material design style without depending on API level 11.

While this may be used to draw an indeterminate spinner using start() and stop() methods, this may also be used to draw a progress arc using setStartEndTrim(float, float) method. CircularProgressDrawable also supports adding an arrow at the end of the arc by setArrowEnabled(boolean) and setArrowDimensions(float, float) methods.

To use one of the pre-defined sizes instead of using your own, setStyle(int) should be called with one of the DEFAULT or LARGE styles as its parameter. Doing it so will update the arrow dimensions, ring size and stroke width to fit the one specified.

If no center radius is set via setCenterRadius(float) or setStyle(int) methods, CircularProgressDrawable will fill the bounds set via setBounds(Rect).




Maps to ProgressBar default style.


Maps to ProgressBar.Large style.

Public constructors

CircularProgressDrawable(Context context)

Public methods

void draw(Canvas canvas)
int getAlpha()
boolean getArrowEnabled()

Returns true if the arrow at the end of the spinner is shown.

float getArrowHeight()

Returns the arrow height in pixels.

float getArrowScale()

Returns the scale of the arrow at the end of the spinner.

float getArrowWidth()

Returns the arrow width in pixels.

int getBackgroundColor()

Returns the background color of the circle drawn inside the drawable.

float getCenterRadius()

Returns the center radius for the progress spinner in pixels.

int[] getColorSchemeColors()

Returns the colors used in the progress animation

float getEndTrim()

Returns the end trim for the progress spinner arc

int getOpacity()
float getProgressRotation()

Returns the amount of rotation applied to the progress spinner.

float getStartTrim()

Returns the start trim for the progress spinner arc