CircularProgressIndicator


public class CircularProgressIndicator implements LayoutElementBuilders.LayoutElement


ProtoLayout component CircularProgressIndicator that represents circular progress indicator which supports a gap in the circular track between startAngle and endAngle.

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 . Unless specified, the CircularProgressIndicator will have the full length.

The recommended set of ProgressIndicatorColors can be obtained from , e.g. DEFAULT_COLORS to get a default color scheme for a 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.:

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 CircularProgressIndicator object from any layout element, fromLayoutElement method should be used, i.e.:

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

Summary

Nested types

Builder class for CircularProgressIndicator

Public methods

static @Nullable CircularProgressIndicator

Returns CircularProgressIndicator object from the given LayoutElement (e.g. one retrieved from a container's content with container.getContents().get(index)) if that element can be converted to CircularProgressIndicator.

@NonNull ProgressIndicatorColors

Returns main arc color of this CircularProgressIndicator.

@Nullable TypeBuilders.StringProp

Returns content description of this CircularProgressIndicator.

@NonNull DimensionBuilders.DegreesProp

Returns start angle of this CircularProgressIndicator.

@NonNull DimensionBuilders.DegreesProp

Returns angle representing progressed part of this CircularProgressIndicator.

@NonNull DimensionBuilders.DegreesProp

Returns start angle of this CircularProgressIndicator.

@NonNull DimensionBuilders.DpProp

Returns stroke width of this CircularProgressIndicator.

boolean

Returns whether there is a margin around this indicator or not.

Public methods

fromLayoutElement

Added in 1.0.0
public static @Nullable CircularProgressIndicator fromLayoutElement(@NonNull LayoutElementBuilders.LayoutElement element)

Returns CircularProgressIndicator object from the given 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.0.0
public @NonNull ProgressIndicatorColors getCircularProgressIndicatorColors()

Returns main arc color of this CircularProgressIndicator.

getContentDescription

Added in 1.0.0
public @Nullable TypeBuilders.StringProp getContentDescription()

Returns content description of this CircularProgressIndicator.

getEndAngle

Added in 1.0.0
public @NonNull DimensionBuilders.DegreesProp getEndAngle()

Returns start angle of this CircularProgressIndicator.

getProgress

Added in 1.0.0
public @NonNull DimensionBuilders.DegreesProp getProgress()

Returns angle representing progressed part of this CircularProgressIndicator.

getStartAngle

Added in 1.0.0
public @NonNull DimensionBuilders.DegreesProp getStartAngle()

Returns start angle of this CircularProgressIndicator.

getStrokeWidth

Added in 1.0.0
public @NonNull DimensionBuilders.DpProp getStrokeWidth()

Returns stroke width of this CircularProgressIndicator.

isOuterMarginApplied

Added in 1.2.0
public boolean isOuterMarginApplied()

Returns whether there is a margin around this indicator or not.

Jetpack Compose is Android's recommended modern toolkit for building native UI. It simplifies and accelerates UI development on Android. Quickly bring your app to life with less code, powerful tools, and intuitive Kotlin APIs.

Updated Sep 19, 2024

Discover the latest app development tools, platform updates, training, and documentation for developers across every Android device.

Updated Jan 23, 2025

Discover the latest app development tools, platform updates, training, and documentation for developers across every Android device.

Updated Jan 23, 2025