# 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)

*** ** * ** ***


```
public class CircularProgressDrawable extends Drawable implements Animatable
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [android.graphics.drawable.Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable.html) ||
|   | ↳ | [androidx.swiperefreshlayout.widget.CircularProgressDrawable](https://developer.android.com/reference/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/androidx/swiperefreshlayout/widget/CircularProgressDrawable#start()` and `https://developer.android.com/reference/androidx/swiperefreshlayout/widget/CircularProgressDrawable#stop()` methods, this may also be used to draw a progress arc using `https://developer.android.com/reference/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/androidx/swiperefreshlayout/widget/CircularProgressDrawable#setArrowEnabled(boolean)` and `https://developer.android.com/reference/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/androidx/swiperefreshlayout/widget/CircularProgressDrawable#setStyle(int)` should be called with one of the `https://developer.android.com/reference/androidx/swiperefreshlayout/widget/CircularProgressDrawable#DEFAULT()` or `https://developer.android.com/reference/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/androidx/swiperefreshlayout/widget/CircularProgressDrawable#setCenterRadius(float)` or `https://developer.android.com/reference/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 |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/swiperefreshlayout/widget/CircularProgressDrawable#DEFAULT() = 1` Maps to ProgressBar default style. |
| `static final int` | `https://developer.android.com/reference/androidx/swiperefreshlayout/widget/CircularProgressDrawable#LARGE() = 0` Maps to ProgressBar.Large style. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/swiperefreshlayout/widget/CircularProgressDrawable#CircularProgressDrawable(android.content.Context)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context)` |

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

| ### Inherited methods |
|---|
| From [android.graphics.drawable.Drawable](https://developer.android.com/reference/android/graphics/drawable/Drawable.html) |---|---| | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#applyTheme(android.content.res.Resources.Theme)(https://developer.android.com/reference/android/content/res/Resources.Theme.html t)` | | `boolean` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#canApplyTheme()()` | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#clearColorFilter()()` | | `final https://developer.android.com/reference/android/graphics/Rect.html` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#copyBounds()()` | | `final void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#copyBounds(android.graphics.Rect)(https://developer.android.com/reference/android/graphics/Rect.html bounds)` | | `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)(https://developer.android.com/reference/java/lang/String.html pathName)` | | `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)( https://developer.android.com/reference/android/content/res/Resources.html res, https://developer.android.com/reference/android/util/TypedValue.html value, https://developer.android.com/reference/java/io/InputStream.html is, https://developer.android.com/reference/java/lang/String.html srcName )` | | `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)(https://developer.android.com/reference/java/io/InputStream.html is, https://developer.android.com/reference/java/lang/String.html srcName)` | | `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)(https://developer.android.com/reference/android/content/res/Resources.html r, https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html parser)` | | `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)( https://developer.android.com/reference/android/content/res/Resources.html r, https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html parser, https://developer.android.com/reference/android/util/AttributeSet.html attrs )` | | `final 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()()` | | `int` | `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()()` | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getHotspotBounds(android.graphics.Rect)(https://developer.android.com/reference/android/graphics/Rect.html outRect)` | | `int` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getIntrinsicHeight()()` | | `int` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getIntrinsicWidth()()` | | `int` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getLayoutDirection()()` | | `final int` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getLevel()()` | | `int` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getMinimumHeight()()` | | `int` | `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()()` | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getOutline(android.graphics.Outline)(https://developer.android.com/reference/android/graphics/Outline.html outline)` | | `boolean` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#getPadding(android.graphics.Rect)(https://developer.android.com/reference/android/graphics/Rect.html padding)` | | `int[]` | `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()()` | | `boolean` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#hasFocusStateSpecified()()` | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#inflate(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet)(https://developer.android.com/reference/android/content/res/Resources.html r, https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html parser, https://developer.android.com/reference/android/util/AttributeSet.html attrs)` | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#invalidateSelf()()` | | `boolean` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#isAutoMirrored()()` | | `boolean` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#isFilterBitmap()()` | | `boolean` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#isProjected()()` | | `boolean` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#isStateful()()` | | `final boolean` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#isVisible()()` | | `void` | `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()()` | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#onBoundsChange(android.graphics.Rect)(https://developer.android.com/reference/android/graphics/Rect.html bounds)` | | `boolean` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#onLayoutDirectionChanged(int)(int layoutDirection)` | | `boolean` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#onLevelChange(int)(int level)` | | `boolean` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#onStateChange(int[])(int[] state)` | | `static int` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#resolveOpacity(int, int)(int op1, int op2)` | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#scheduleSelf(java.lang.Runnable, long)(https://developer.android.com/reference/java/lang/Runnable.html what, long when)` | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setAutoMirrored(boolean)(boolean mirrored)` | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setBounds(android.graphics.Rect)(https://developer.android.com/reference/android/graphics/Rect.html bounds)` | | `final void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setCallback(android.graphics.drawable.Drawable.Callback)(https://developer.android.com/reference/android/graphics/drawable/Drawable.Callback.html cb)` | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setChangingConfigurations(int)(int configs)` | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setDither(boolean)(boolean dither)` **This method is deprecated.** | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setFilterBitmap(boolean)(boolean filter)` | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setHotspot(float, float)(float x, float y)` | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setHotspotBounds(int, int, int, int)(int left, int top, int right, int bottom)` | | `final boolean` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setLayoutDirection(int)(int layoutDirection)` | | `final boolean` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setLevel(int)(int level)` | | `boolean` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setState(int[])(int[] stateSet)` | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setTint(int)(int tintColor)` | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setTintBlendMode(android.graphics.BlendMode)(https://developer.android.com/reference/android/graphics/BlendMode.html blendMode)` | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setTintList(android.content.res.ColorStateList)(https://developer.android.com/reference/android/content/res/ColorStateList.html tint)` | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setTintMode(android.graphics.PorterDuff.Mode)(https://developer.android.com/reference/android/graphics/PorterDuff.Mode.html tintMode)` | | `boolean` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#setVisible(boolean, boolean)(boolean visible, boolean restart)` | | `void` | `https://developer.android.com/reference/android/graphics/drawable/Drawable.html#unscheduleSelf(java.lang.Runnable)(https://developer.android.com/reference/java/lang/Runnable.html what)` | |

## Constants

### DEFAULT

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

```
public static final int DEFAULT = 1
```

Maps to ProgressBar default style.

### LARGE

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

```
public static final int LARGE = 0
```

Maps to ProgressBar.Large style.

## Public constructors

### CircularProgressDrawable

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

```
public CircularProgressDrawable(@NonNull Context context)
```

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context` | application context |

## Public methods

### draw

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

```
public void draw(@NonNull Canvas canvas)
```

### getAlpha

```
public int getAlpha()
```

### getArrowEnabled

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

```
public boolean getArrowEnabled()
```

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

| Returns |
|---|---|
| `boolean` | `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)

```
public float getArrowHeight()
```

Returns the arrow height in pixels.

| Returns |
|---|---|
| `float` | arrow height in pixels |

### getArrowScale

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

```
public float getArrowScale()
```

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

| Returns |
|---|---|
| `float` | scale of the arrow |

### getArrowWidth

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

```
public float getArrowWidth()
```

Returns the arrow width in pixels.

| Returns |
|---|---|
| `float` | arrow width in pixels |

### getBackgroundColor

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

```
public int getBackgroundColor()
```

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

| Returns |
|---|---|
| `int` | an ARGB color |

### getCenterRadius

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

```
public float getCenterRadius()
```

Returns the center radius for the progress spinner in pixels.

| Returns |
|---|---|
| `float` | center radius in pixels |

### getColorSchemeColors

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

```
public @NonNull int[] getColorSchemeColors()
```

Returns the colors used in the progress animation

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html int[]` | list of ARGB colors |

### getEndTrim

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

```
public float getEndTrim()
```

Returns the end trim for the progress spinner arc

| Returns |
|---|---|
| `float` | end trim from \[0..1\] |

### getOpacity

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

```
public int getOpacity()
```

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

### getProgressRotation

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

```
public float getProgressRotation()
```

Returns the amount of rotation applied to the progress spinner.

| Returns |
|---|---|
| `float` | amount of rotation from \[0..1\] |

### getStartTrim

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

```
public float getStartTrim()
```

Returns the start trim for the progress spinner arc

| Returns |
|---|---|
| `float` | start trim from \[0..1\] |

### getStrokeCap

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

```
public @NonNull Paint.Cap getStrokeCap()
```

Returns the stroke cap of the progress spinner.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html 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)

```
public float getStrokeWidth()
```

Returns the stroke width for the progress spinner in pixels.

| Returns |
|---|---|
| `float` | stroke width in pixels |

### isRunning

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

```
public boolean isRunning()
```

### setAlpha

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

```
public void setAlpha(int alpha)
```

### setArrowDimensions

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

```
public void setArrowDimensions(float width, float height)
```

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

| Parameters |
|---|---|
| `float width` | width of the baseline of the arrow in pixels |
| `float height` | 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)

```
public void setArrowEnabled(boolean show)
```

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

| Parameters |
|---|---|
| `boolean show` | `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)

```
public void setArrowScale(float scale)
```

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

| Parameters |
|---|---|
| `float scale` | 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)

```
public void setBackgroundColor(int color)
```

Sets the background color of the circle inside the drawable. Calling `https://developer.android.com/reference/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 |
|---|---|
| `int color` | an ARGB color |

### setCenterRadius

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

```
public void setCenterRadius(float centerRadius)
```

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

| Parameters |
|---|---|
| `float centerRadius` | center radius in pixels |

### setColorFilter

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

```
public void setColorFilter(ColorFilter colorFilter)
```

### setColorSchemeColors

```
public void setColorSchemeColors(@NonNull int[] colors)
```

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 |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html int[] colors` | 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)

```
public void setProgressRotation(float rotation)
```

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

| Parameters |
|---|---|
| `float rotation` | rotation from \[0..1\] |

### setStartEndTrim

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

```
public void setStartEndTrim(float start, float end)
```

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 |
|---|---|
| `float start` | starting position of the arc from \[0..1\] |
| `float end` | 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)

```
public void setStrokeCap(@NonNull Paint.Cap strokeCap)
```

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

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/graphics/Paint.Cap.html strokeCap` | stroke cap |

### setStrokeWidth

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

```
public void setStrokeWidth(float strokeWidth)
```

Sets the stroke width for the progress spinner in pixels.

| Parameters |
|---|---|
| `float strokeWidth` | stroke width in pixels |

### setStyle

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

```
public void setStyle(int size)
```

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

| Parameters |
|---|---|
| `int size` | one of `https://developer.android.com/reference/androidx/swiperefreshlayout/widget/CircularProgressDrawable#LARGE()` or `https://developer.android.com/reference/androidx/swiperefreshlayout/widget/CircularProgressDrawable#DEFAULT()` |

### start

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

```
public void start()
```

Starts the animation for the spinner.

### stop

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

```
public void stop()
```

Stops the animation for the spinner.