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

*** ** * ** ***


```
public final class CircularProgressIndicator.Builder
```

<br />

*** ** * ** ***

Builder class for `https://developer.android.com/reference/androidx/wear/protolayout/material/CircularProgressIndicator`

## Summary

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

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

```
public Builder()
```

Creates a builder for the `https://developer.android.com/reference/androidx/wear/protolayout/material/CircularProgressIndicator`.

## Public methods

### build

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

```
public @NonNull CircularProgressIndicator build()
```

Constructs and returns `https://developer.android.com/reference/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)

```
public @NonNull CircularProgressIndicator.Builder setCircularProgressIndicatorColors(
    @NonNull ProgressIndicatorColors circularProgressIndicatorColors
)
```

Sets the colors for the `https://developer.android.com/reference/androidx/wear/protolayout/material/CircularProgressIndicator`. If set, `https://developer.android.com/reference/androidx/wear/protolayout/material/ProgressIndicatorColors#getIndicatorColor()` will be used for a progress that has been made, while `https://developer.android.com/reference/androidx/wear/protolayout/material/ProgressIndicatorColors#getTrackColor()` will be used for a background full size arc. If not set, `https://developer.android.com/reference/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)

```
public @NonNull CircularProgressIndicator.Builder setContentDescription(@NonNull CharSequence contentDescription)
```

Sets the static content description of the `https://developer.android.com/reference/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)

```
public @NonNull CircularProgressIndicator.Builder setContentDescription(
    @NonNull TypeBuilders.StringProp contentDescription
)
```

Sets the content description of the `https://developer.android.com/reference/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)

```
public @NonNull CircularProgressIndicator.Builder setEndAngle(float endAngle)
```

Sets the end angle of the `https://developer.android.com/reference/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)

```
public @NonNull CircularProgressIndicator.Builder setOuterMarginApplied(boolean isApplied)
```

Sets whether this `https://developer.android.com/reference/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 `https://developer.android.com/reference/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)

```
public @NonNull CircularProgressIndicator.Builder setProgress(@FloatRange(from = 0, to = 1) float progressRatio)
```

Sets the progress of the `https://developer.android.com/reference/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 `https://developer.android.com/reference/androidx/wear/protolayout/material/ProgressIndicatorColors#getIndicatorColor()`.

### setProgress

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

```
public @NonNull CircularProgressIndicator.Builder setProgress(@NonNull TypeBuilders.FloatProp progressRatio)
```

Sets the progress of the `https://developer.android.com/reference/androidx/wear/protolayout/material/CircularProgressIndicator`. If not set, static value provided using `https://developer.android.com/reference/androidx/wear/protolayout/material/CircularProgressIndicator.Builder#setProgress(float)` will be used, or 0. Progress will be colored in `https://developer.android.com/reference/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 |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/TypeBuilders.FloatProp progressRatio` | 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)

```
public @NonNull CircularProgressIndicator.Builder setStartAngle(float startAngle)
```

Sets the start angle of the `https://developer.android.com/reference/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)

```
public @NonNull CircularProgressIndicator.Builder setStrokeWidth(@NonNull DimensionBuilders.DpProp strokeWidth)
```

Sets the stroke width of the `https://developer.android.com/reference/androidx/wear/protolayout/material/CircularProgressIndicator`. Strongly recommended value is `https://developer.android.com/reference/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)

```
public @NonNull CircularProgressIndicator.Builder setStrokeWidth(@Dimension(unit = 0) float strokeWidth)
```

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