# CircularProgressIndicator.Builder

# CircularProgressIndicator.Builder

Artifact:[androidx.wear.protolayout:protolayout-material](https://developer.android.com/jetpack/androidx/releases/wear-protolayout)  
[View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/material/CircularProgressIndicator.java+class:androidx.wear.protolayout.material.CircularProgressIndicator.Builder)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/wear/protolayout/material/CircularProgressIndicator.Builder "View this page in Java")

<br />

```
class CircularProgressIndicator.Builder
```

<br />

*** ** * ** ***

Builder class for[CircularProgressIndicator](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator)

## Summary

|                                                                                                                                             ### Public constructors                                                                                                                                             |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator.Builder#Builder())`()` Creates a builder for the[CircularProgressIndicator](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator). |

|                                                                   ### Public functions                                                                   |
|----------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [CircularProgressIndicator](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator)                 | [build](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator.Builder#build())`()` Constructs and returns[CircularProgressIndicator](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator)with the provided field and look.                                                                                                                                                                                                                                                                  |
| [CircularProgressIndicator.Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator.Builder) | [setCircularProgressIndicatorColors](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator.Builder#setCircularProgressIndicatorColors(androidx.wear.protolayout.material.ProgressIndicatorColors))`(` ` circularProgressIndicatorColors: `[ProgressIndicatorColors](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/ProgressIndicatorColors) `)` Sets the colors for the[CircularProgressIndicator](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator). |
| [CircularProgressIndicator.Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator.Builder) | [setContentDescription](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator.Builder#setContentDescription(java.lang.CharSequence))`(contentDescription: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`)` Sets the static content description of the[CircularProgressIndicator](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator)to be used for accessibility support.                                                                |
| [CircularProgressIndicator.Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator.Builder) | [setContentDescription](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator.Builder#setContentDescription(androidx.wear.protolayout.TypeBuilders.StringProp))`(contentDescription: `[TypeBuilders.StringProp](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/TypeBuilders.StringProp)`)` Sets the content description of the[CircularProgressIndicator](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator)to be used for accessibility support.               |
| [CircularProgressIndicator.Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator.Builder) | [setEndAngle](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator.Builder#setEndAngle(float))`(endAngle: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Sets the end angle of the[CircularProgressIndicator](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator)'s background arc, where angle 0 is 12 o'clock.                                                                                                                                     |
| [CircularProgressIndicator.Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator.Builder) | [setOuterMarginApplied](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator.Builder#setOuterMarginApplied(boolean))`(isApplied: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Sets whether this[CircularProgressIndicator](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator)should have outer margin or not.                                                                                                                                 |
| [CircularProgressIndicator.Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator.Builder) | [setProgress](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator.Builder#setProgress(float))`(progressRatio: @`[FloatRange](https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange)`(from = 0, to = 1) `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Sets the progress of the[CircularProgressIndicator](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator).                                                              |
| [CircularProgressIndicator.Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator.Builder) | [setProgress](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator.Builder#setProgress(androidx.wear.protolayout.TypeBuilders.FloatProp))`(progressRatio: `[TypeBuilders.FloatProp](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/TypeBuilders.FloatProp)`)` Sets the progress of the[CircularProgressIndicator](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator).                                                                                          |
| [CircularProgressIndicator.Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator.Builder) | [setStartAngle](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator.Builder#setStartAngle(float))`(startAngle: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Sets the start angle of the[CircularProgressIndicator](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator)'s background arc, where angle 0 is 12 o'clock.                                                                                                                             |
| [CircularProgressIndicator.Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator.Builder) | [setStrokeWidth](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator.Builder#setStrokeWidth(androidx.wear.protolayout.DimensionBuilders.DpProp))`(strokeWidth: `[DimensionBuilders.DpProp](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/DimensionBuilders.DpProp)`)` Sets the stroke width of the[CircularProgressIndicator](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator).                                                                            |
| [CircularProgressIndicator.Builder](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator.Builder) | [setStrokeWidth](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator.Builder#setStrokeWidth(float))`(strokeWidth: @`[Dimension](https://developer.android.com/reference/kotlin/androidx/annotation/Dimension)`(unit = 0) `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Sets the stroke width of the[CircularProgressIndicator](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator).                                                                |

## Public constructors

### Builder

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

```
Builder()
```

Creates a builder for the[CircularProgressIndicator](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator).  

## Public functions

### build

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

```
fun build(): CircularProgressIndicator
```

Constructs and returns[CircularProgressIndicator](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator)with the provided field and look.  

### setCircularProgressIndicatorColors

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

```
fun setCircularProgressIndicatorColors(
    circularProgressIndicatorColors: ProgressIndicatorColors
): CircularProgressIndicator.Builder
```

Sets the colors for the[CircularProgressIndicator](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator). If set,[getIndicatorColor](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/ProgressIndicatorColors#getIndicatorColor())will be used for a progress that has been made, while[getTrackColor](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/ProgressIndicatorColors#getTrackColor())will be used for a background full size arc. If not set,[DEFAULT_COLORS](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/ProgressIndicatorDefaults#DEFAULT_COLORS())will be used.  

### setContentDescription

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

```
fun setContentDescription(contentDescription: CharSequence): CircularProgressIndicator.Builder
```

Sets the static content description of the[CircularProgressIndicator](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator)to be used for accessibility support.  

### setContentDescription

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

```
fun setContentDescription(contentDescription: TypeBuilders.StringProp): CircularProgressIndicator.Builder
```

Sets the content description of the[CircularProgressIndicator](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator)to be used for accessibility support.

While this field is statically accessible from 1.0, it's only bindable since version 1.2 and renderers supporting version 1.2 will use the dynamic value (if set).  

### setEndAngle

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

```
fun setEndAngle(endAngle: Float): CircularProgressIndicator.Builder
```

Sets the end angle of the[CircularProgressIndicator](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator)'s background arc, where angle 0 is 12 o'clock. End angle doesn't need to be within 0-360 range, but it must be larger than start angle. If not set 360 will be used and the indicator will have full length.  

### setOuterMarginApplied

Added in[1.2.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.2.0)  

```
fun setOuterMarginApplied(isApplied: Boolean): CircularProgressIndicator.Builder
```

Sets whether this[CircularProgressIndicator](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator)should have outer margin or not.

If this indicator is used as a smaller element, use this method to remove an additional margin around it by setting it to`false`.

Otherwise, if this indicator is used as a full screen one or in[androidx.wear.protolayout.material.layouts.EdgeContentLayout](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/layouts/EdgeContentLayout), it's strongly recommended to set this to`true`.

If not set, defaults to true.  

### setProgress

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

```
fun setProgress(progressRatio: @FloatRange(from = 0, to = 1) Float): CircularProgressIndicator.Builder
```

Sets the progress of the[CircularProgressIndicator](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator). Progress ratio should be a value between 0 and 1. If not set, 0 will be used. Progress will be colored in[getIndicatorColor](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/ProgressIndicatorColors#getIndicatorColor()).  

### setProgress

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

```
fun setProgress(progressRatio: TypeBuilders.FloatProp): CircularProgressIndicator.Builder
```

Sets the progress of the[CircularProgressIndicator](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator). If not set, static value provided using[setProgress](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator.Builder#setProgress(float))will be used, or 0. Progress will be colored in[getIndicatorColor](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/ProgressIndicatorColors#getIndicatorColor()).

While this field is statically accessible from 1.0, it's only bindable since version 1.2 and renderers supporting version 1.2 will use the dynamic value (if set).  

|                                                                 Parameters                                                                 |
|--------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `progressRatio: `[TypeBuilders.FloatProp](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/TypeBuilders.FloatProp) | The progress between 0 and 1. This field supports setting a dynamic value. The static value of`progressRatio`will be considered as 0 if it's smaller than zero and as 1 if it's larger than one. |

### setStartAngle

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

```
fun setStartAngle(startAngle: Float): CircularProgressIndicator.Builder
```

Sets the start angle of the[CircularProgressIndicator](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator)'s background arc, where angle 0 is 12 o'clock. Start angle doesn't need to be within 0-360 range. I.e. -90 is to start arc from the 9 o'clock. If not set 0 will be used and the indicator will have full length.  

### setStrokeWidth

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

```
fun setStrokeWidth(strokeWidth: DimensionBuilders.DpProp): CircularProgressIndicator.Builder
```

Sets the stroke width of the[CircularProgressIndicator](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator). Strongly recommended value is[DEFAULT_STROKE_WIDTH](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/ProgressIndicatorDefaults#DEFAULT_STROKE_WIDTH()).  

### setStrokeWidth

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

```
fun setStrokeWidth(strokeWidth: @Dimension(unit = 0) Float): CircularProgressIndicator.Builder
```

Sets the stroke width of the[CircularProgressIndicator](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator). Strongly recommended value is[DEFAULT_STROKE_WIDTH](https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/ProgressIndicatorDefaults#DEFAULT_STROKE_WIDTH()).