# CircularProgressIndicator

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

*** ** * ** ***


```
class CircularProgressIndicator : LayoutElementBuilders.LayoutElement
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
>
> Use the new class `https://developer.android.com/reference/kotlin/androidx/wear/protolayout/material/CircularProgressIndicator` which provides the same API and functionality.

Tiles component `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/CircularProgressIndicator` that represents circular progress indicator which supports a gap in the circular track between startAngle and endAngle. \[Progress Indicator doc\] (https://developer.android.com/training/wearables/components/progress-indicator)

The CircularProgressIndicator is a colored arc around the edge of the screen with the given start and end angles, which can describe a full or partial circle. Behind it is an arc with optional gap representing full progress. The recommended sizes are defined in `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/ProgressIndicatorDefaults`. Unless specified, the CircularProgressIndicator will have the full length.

The recommended set of `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/ProgressIndicatorColors` can be obtained from `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/ProgressIndicatorDefaults`, e.g. `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/ProgressIndicatorDefaults#DEFAULT_COLORS()` to get a default color scheme for a `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/CircularProgressIndicator`.

When accessing the contents of a container for testing, note that this element can't be simply casted back to the original type, i.e.:

```kotlin
CircularProgressIndicator cpi = new CircularProgressIndicator...
Box box = new Box.Builder().addContent(cpi).build();

CircularProgressIndicator myCpi = (CircularProgressIndicator) box.getContents().get(0);
```
will fail.

To be able to get `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/CircularProgressIndicator` object from any layout element, `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/CircularProgressIndicator#fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement)` method should be used, i.e.:

```kotlin
CircularProgressIndicator myCpi =
  CircularProgressIndicator.fromLayoutElement(box.getContents().get(0));
```

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/CircularProgressIndicator.Builder : https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.LayoutElement.Builder` **This class is deprecated.** Deprecated in Java |

| ### Public functions |
|---|---|
| `java-static https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/CircularProgressIndicator?` | `[fromLayoutElement](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/CircularProgressIndicator#fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement))(element: https://developer.android.com/reference/kotlin/androidx/wear/tiles/LayoutElementBuilders.LayoutElement)` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/ProgressIndicatorColors` | `[getCircularProgressIndicatorColors](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/CircularProgressIndicator#getCircularProgressIndicatorColors())()` **This function is deprecated.** Deprecated in Java |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html?` | `[getContentDescription](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/CircularProgressIndicator#getContentDescription())()` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/DimensionBuilders.DegreesProp` | `[getEndAngle](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/CircularProgressIndicator#getEndAngle())()` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/DimensionBuilders.DegreesProp` | `[getProgress](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/CircularProgressIndicator#getProgress())()` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/DimensionBuilders.DegreesProp` | `[getStartAngle](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/CircularProgressIndicator#getStartAngle())()` **This function is deprecated.** Deprecated in Java |
| `https://developer.android.com/reference/kotlin/androidx/wear/tiles/DimensionBuilders.DpProp` | `[getStrokeWidth](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/CircularProgressIndicator#getStrokeWidth())()` **This function is deprecated.** Deprecated in Java |

## Public functions

### fromLayoutElement

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

```
java-static fun [fromLayoutElement](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/CircularProgressIndicator#fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement))(element: LayoutElementBuilders.LayoutElement): CircularProgressIndicator?
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Returns CircularProgressIndicator object from the given androidx.wear.tiles.LayoutElementBuilders.LayoutElement (e.g. one retrieved from a container's content with `container.getContents().get(index)`) if that element can be converted to CircularProgressIndicator. Otherwise, it will return null.

### getCircularProgressIndicatorColors

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

```
fun [getCircularProgressIndicatorColors](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/CircularProgressIndicator#getCircularProgressIndicatorColors())(): ProgressIndicatorColors
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Returns main arc color of this CircularProgressIndicator.

### getContentDescription

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

```
fun [getContentDescription](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/CircularProgressIndicator#getContentDescription())(): CharSequence?
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Returns content description of this CircularProgressIndicator.

### getEndAngle

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

```
fun [getEndAngle](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/CircularProgressIndicator#getEndAngle())(): DimensionBuilders.DegreesProp
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Returns start angle of this CircularProgressIndicator.

### getProgress

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

```
fun [getProgress](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/CircularProgressIndicator#getProgress())(): DimensionBuilders.DegreesProp
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Returns angle representing progressed part of this CircularProgressIndicator.

### getStartAngle

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

```
fun [getStartAngle](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/CircularProgressIndicator#getStartAngle())(): DimensionBuilders.DegreesProp
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Returns start angle of this CircularProgressIndicator.

### getStrokeWidth

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

```
fun [getStrokeWidth](https://developer.android.com/reference/kotlin/androidx/wear/tiles/material/CircularProgressIndicator#getStrokeWidth())(): DimensionBuilders.DpProp
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Returns stroke width of this CircularProgressIndicator.