# CircularProgressDrawable

Artifact: [androidx.swiperefreshlayout:swiperefreshlayout](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout) [View Source](https://cs.android.com/search?q=file:androidx/swiperefreshlayout/widget/CircularProgressDrawable.java+class:androidx.swiperefreshlayout.widget.CircularProgressDrawable) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

*** ** * ** ***

<br />

```
class CircularProgressDrawable : Drawable, Animatable
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [android.graphics.drawable.Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable.html) ||
|   | ↳ | [androidx.swiperefreshlayout.widget.CircularProgressDrawable](https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable) |

*** ** * ** ***

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 `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#start()` and `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#stop()` methods, this may also be used to draw a progress arc using `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#setStartEndTrim(float,float)` method. CircularProgressDrawable also supports adding an arrow at the end of the arc by `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#setArrowEnabled(boolean)` and `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#setArrowDimensions(float,float)` methods.

To use one of the pre-defined sizes instead of using your own, `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#setStyle(int)` should be called with one of the `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#DEFAULT()` or `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#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 `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#setCenterRadius(float)` or `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#setStyle(int)` methods, CircularProgressDrawable will fill the bounds set via `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setBounds(android.graphics.Rect)`.

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#DEFAULT() = 1` Maps to ProgressBar default style. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#LARGE() = 0` Maps to ProgressBar.Large style. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#CircularProgressDrawable(android.content.Context)(context: https://developer.android.com/reference/android/content/Context.html)` |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#draw(android.graphics.Canvas)(canvas: https://developer.android.com/reference/android/graphics/Canvas.html)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#getAlpha()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#getArrowEnabled()()` Returns `true` if the arrow at the end of the spinner is shown. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#getArrowHeight()()` Returns the arrow height in pixels. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#getArrowScale()()` Returns the scale of the arrow at the end of the spinner. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#getArrowWidth()()` Returns the arrow width in pixels. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#getBackgroundColor()()` Returns the background color of the circle drawn inside the drawable. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#getCenterRadius()()` Returns the center radius for the progress spinner in pixels. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#getColorSchemeColors()()` Returns the colors used in the progress animation |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#getEndTrim()()` Returns the end trim for the progress spinner arc |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#getOpacity()()` **This function is deprecated.** |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#getProgressRotation()()` Returns the amount of rotation applied to the progress spinner. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#getStartTrim()()` Returns the start trim for the progress spinner arc |
| `https://developer.android.com/reference/android/graphics/Paint.Cap.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#getStrokeCap()()` Returns the stroke cap of the progress spinner. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#getStrokeWidth()()` Returns the stroke width for the progress spinner in pixels. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#isRunning()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#setAlpha(int)(alpha: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#setArrowDimensions(float,float)(width: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, height: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Sets the dimensions of the arrow at the end of the spinner in pixels. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#setArrowEnabled(boolean)(show: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Sets if the arrow at the end of the spinner should be shown. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#setArrowScale(float)(scale: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Sets the scale of the arrow at the end of the spinner. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#setBackgroundColor(int)(color: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets the background color of the circle inside the drawable. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#setCenterRadius(float)(centerRadius: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Sets the center radius for the progress spinner in pixels. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#setColorFilter(android.graphics.ColorFilter)(colorFilter: https://developer.android.com/reference/android/graphics/ColorFilter.html!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#setColorSchemeColors(int...)(colors: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>)` Sets the colors used in the progress animation from a color list. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#setProgressRotation(float)(rotation: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Sets the amount of rotation to apply to the progress spinner. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#setStartEndTrim(float,float)(start: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, end: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Sets the start and end trim for the progress spinner arc. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#setStrokeCap(android.graphics.Paint.Cap)(strokeCap: https://developer.android.com/reference/android/graphics/Paint.Cap.html)` Sets the stroke cap of the progress spinner. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#setStrokeWidth(float)(strokeWidth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Sets the stroke width for the progress spinner in pixels. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#setStyle(int)(size: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets the overall size for the progress spinner. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#start()()` Starts the animation for the spinner. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#stop()()` Stops the animation for the spinner. |

### Inherited functions

From [android.graphics.drawable.Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable.html) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#applyTheme(android.content.res.Resources.Theme)(t: https://developer.android.com/reference/android/content/res/Resources.Theme.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#canApplyTheme()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#clearColorFilter()()` `https://developer.android.com/reference/android/graphics/Rect.html!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#copyBounds()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#copyBounds(android.graphics.Rect)(bounds: https://developer.android.com/reference/android/graphics/Rect.html!)` `java-static https://developer.android.com/reference/android/graphics/drawable/Drawable.html!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#createFromPath(java.lang.String)(pathName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `java-static https://developer.android.com/reference/android/graphics/drawable/Drawable.html!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#createFromResourceStream(android.content.res.Resources, android.util.TypedValue, java.io.InputStream, java.lang.String)(

res: https://developer.android.com/reference/android/content/res/Resources.html!,

value: https://developer.android.com/reference/android/util/TypedValue.html!,

is: https://developer.android.com/reference/java/io/InputStream.html!,

srcName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!

)` `java-static https://developer.android.com/reference/android/graphics/drawable/Drawable.html!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#createFromStream(java.io.InputStream, java.lang.String)(is: https://developer.android.com/reference/java/io/InputStream.html!, srcName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` `java-static https://developer.android.com/reference/android/graphics/drawable/Drawable.html!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#createFromXml(android.content.res.Resources, org.xmlpull.v1.XmlPullParser)(r: https://developer.android.com/reference/android/content/res/Resources.html!, parser: https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html!)` `java-static https://developer.android.com/reference/android/graphics/drawable/Drawable.html!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#createFromXmlInner(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet)(

r: https://developer.android.com/reference/android/content/res/Resources.html!,

parser: https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html!,

attrs: https://developer.android.com/reference/android/util/AttributeSet.html!

)` `https://developer.android.com/reference/android/graphics/Rect.html!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getBounds()()` `https://developer.android.com/reference/android/graphics/drawable/Drawable.Callback.html!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getCallback()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getChangingConfigurations()()` `https://developer.android.com/reference/android/graphics/ColorFilter.html!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getColorFilter()()` `https://developer.android.com/reference/android/graphics/drawable/Drawable.ConstantState.html!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getConstantState()()` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getCurrent()()` `https://developer.android.com/reference/android/graphics/Rect.html!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getDirtyBounds()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getHotspotBounds(android.graphics.Rect)(outRect: https://developer.android.com/reference/android/graphics/Rect.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getIntrinsicHeight()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getIntrinsicWidth()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getLayoutDirection()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getLevel()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getMinimumHeight()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getMinimumWidth()()` `https://developer.android.com/reference/android/graphics/Insets.html!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getOpticalInsets()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getOutline(android.graphics.Outline)(outline: https://developer.android.com/reference/android/graphics/Outline.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getPadding(android.graphics.Rect)(padding: https://developer.android.com/reference/android/graphics/Rect.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getState()()` `https://developer.android.com/reference/android/graphics/Region.html!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getTransparentRegion()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#hasFocusStateSpecified()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#inflate(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet)(r: https://developer.android.com/reference/android/content/res/Resources.html!, parser: https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html!, attrs: https://developer.android.com/reference/android/util/AttributeSet.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#invalidateSelf()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#isAutoMirrored()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#isFilterBitmap()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#isProjected()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#isStateful()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#isVisible()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#jumpToCurrentState()()` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html!` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#mutate()()` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#onBoundsChange(android.graphics.Rect)(bounds: https://developer.android.com/reference/android/graphics/Rect.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#onLayoutDirectionChanged(int)(layoutDirection: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#onLevelChange(int)(level: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#onStateChange(int[])(state: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>!)` `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#resolveOpacity(int, int)(op1: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, op2: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#scheduleSelf(java.lang.Runnable, long)(what: https://developer.android.com/reference/java/lang/Runnable.html!, when: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setAutoMirrored(boolean)(mirrored: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setBounds(android.graphics.Rect)(bounds: https://developer.android.com/reference/android/graphics/Rect.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setCallback(android.graphics.drawable.Drawable.Callback)(cb: https://developer.android.com/reference/android/graphics/drawable/Drawable.Callback.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setChangingConfigurations(int)(configs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setDither(boolean)(dither: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`

**This function is deprecated.**
`https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setFilterBitmap(boolean)(filter: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setHotspot(float, float)(x: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, y: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setHotspotBounds(int, int, int, int)(left: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, top: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, right: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, bottom: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setLayoutDirection(int)(layoutDirection: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setLevel(int)(level: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setState(int[])(stateSet: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setTint(int)(tintColor: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setTintBlendMode(android.graphics.BlendMode)(blendMode: https://developer.android.com/reference/android/graphics/BlendMode.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setTintList(android.content.res.ColorStateList)(tint: https://developer.android.com/reference/android/content/res/ColorStateList.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setTintMode(android.graphics.PorterDuff.Mode)(tintMode: https://developer.android.com/reference/android/graphics/PorterDuff.Mode.html!)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setVisible(boolean, boolean)(visible: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, restart: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#unscheduleSelf(java.lang.Runnable)(what: https://developer.android.com/reference/java/lang/Runnable.html!)`

## Constants

### DEFAULT

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
const val DEFAULT = 1: Int
```

Maps to ProgressBar default style.

### LARGE

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
const val LARGE = 0: Int
```

Maps to ProgressBar.Large style.

## Public constructors

### CircularProgressDrawable

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
CircularProgressDrawable(context: Context)
```

| Parameters |
|---|---|
| `context: https://developer.android.com/reference/android/content/Context.html` | application context |

## Public functions

### draw

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
fun draw(canvas: Canvas): Unit
```

### getAlpha

```
fun getAlpha(): Int
```

### getArrowEnabled

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
fun getArrowEnabled(): Boolean
```

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

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if the arrow is shown, `false` otherwise. |

### getArrowHeight

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
fun getArrowHeight(): Float
```

Returns the arrow height in pixels.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | arrow height in pixels |

### getArrowScale

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
fun getArrowScale(): Float
```

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

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | scale of the arrow |

### getArrowWidth

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
fun getArrowWidth(): Float
```

Returns the arrow width in pixels.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | arrow width in pixels |

### getBackgroundColor

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
fun getBackgroundColor(): Int
```

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

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | an ARGB color |

### getCenterRadius

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
fun getCenterRadius(): Float
```

Returns the center radius for the progress spinner in pixels.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | center radius in pixels |

### getColorSchemeColors

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
fun getColorSchemeColors(): Array<Int>
```

Returns the colors used in the progress animation

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>` | list of ARGB colors |

### getEndTrim

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
fun getEndTrim(): Float
```

Returns the end trim for the progress spinner arc

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | end trim from \[0..1\] |

### getOpacity

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
fun getOpacity(): Int
```

> [!CAUTION]
> **This function is deprecated.**   

### getProgressRotation

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
fun getProgressRotation(): Float
```

Returns the amount of rotation applied to the progress spinner.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | amount of rotation from \[0..1\] |

### getStartTrim

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
fun getStartTrim(): Float
```

Returns the start trim for the progress spinner arc

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | start trim from \[0..1\] |

### getStrokeCap

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
fun getStrokeCap(): Paint.Cap
```

Returns the stroke cap of the progress spinner.

| Returns |
|---|---|
| `https://developer.android.com/reference/android/graphics/Paint.Cap.html` | stroke cap |

### getStrokeWidth

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
fun getStrokeWidth(): Float
```

Returns the stroke width for the progress spinner in pixels.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | stroke width in pixels |

### isRunning

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
fun isRunning(): Boolean
```

### setAlpha

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
fun setAlpha(alpha: Int): Unit
```

### setArrowDimensions

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
fun setArrowDimensions(width: Float, height: Float): Unit
```

Sets the dimensions of the arrow at the end of the spinner in pixels.

| Parameters |
|---|---|
| `width: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | width of the baseline of the arrow in pixels |
| `height: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | distance from tip of the arrow to its baseline in pixels |

### setArrowEnabled

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
fun setArrowEnabled(show: Boolean): Unit
```

Sets if the arrow at the end of the spinner should be shown.

| Parameters |
|---|---|
| `show: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if the arrow should be drawn, `false` otherwise |

### setArrowScale

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
fun setArrowScale(scale: Float): Unit
```

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

| Parameters |
|---|---|
| `scale: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | scaling that will be applied to the arrow's both width and height when drawing. |

### setBackgroundColor

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
fun setBackgroundColor(color: Int): Unit
```

Sets the background color of the circle inside the drawable. Calling `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#setAlpha(int)` does not affect the visibility background color, so it should be set separately if it needs to be hidden or visible.

| Parameters |
|---|---|
| `color: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | an ARGB color |

### setCenterRadius

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
fun setCenterRadius(centerRadius: Float): Unit
```

Sets the center radius for the progress spinner in pixels. If set to 0, this drawable will fill the bounds when drawn.

| Parameters |
|---|---|
| `centerRadius: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | center radius in pixels |

### setColorFilter

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
fun setColorFilter(colorFilter: ColorFilter!): Unit
```

### setColorSchemeColors

```
fun setColorSchemeColors(colors: IntArray<Int>): Unit
```

Sets the colors used in the progress animation from a color list. The first color will also be the color to be used if animation is not started yet.

| Parameters |
|---|---|
| `colors: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>` | list of ARGB colors to be used in the spinner |

### setProgressRotation

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
fun setProgressRotation(rotation: Float): Unit
```

Sets the amount of rotation to apply to the progress spinner.

| Parameters |
|---|---|
| `rotation: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | rotation from \[0..1\] |

### setStartEndTrim

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
fun setStartEndTrim(start: Float, end: Float): Unit
```

Sets the start and end trim for the progress spinner arc. 0 corresponds to the geometric angle of 0 degrees (3 o'clock on a watch) and it increases clockwise, coming to a full circle at 1.

| Parameters |
|---|---|
| `start: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | starting position of the arc from \[0..1\] |
| `end: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | ending position of the arc from \[0..1\] |

### setStrokeCap

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
fun setStrokeCap(strokeCap: Paint.Cap): Unit
```

Sets the stroke cap of the progress spinner. Default stroke cap is `https://developer.android.com/reference/android/graphics/Paint.Cap.html#SQUARE`.

| Parameters |
|---|---|
| `strokeCap: https://developer.android.com/reference/android/graphics/Paint.Cap.html` | stroke cap |

### setStrokeWidth

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
fun setStrokeWidth(strokeWidth: Float): Unit
```

Sets the stroke width for the progress spinner in pixels.

| Parameters |
|---|---|
| `strokeWidth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | stroke width in pixels |

### setStyle

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
fun setStyle(size: Int): Unit
```

Sets the overall size for the progress spinner. This updates the radius and stroke width of the ring, and arrow dimensions.

| Parameters |
|---|---|
| `size: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | one of `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#LARGE()` or `https://developer.android.com/reference/kotlin/androidx/swiperefreshlayout/widget/CircularProgressDrawable#DEFAULT()` |

### start

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
fun start(): Unit
```

Starts the animation for the spinner.

### stop

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/swiperefreshlayout#1.0.0)

```
fun stop(): Unit
```

Stops the animation for the spinner.