CircularProgressIndicator
public class CircularProgressIndicator implements LayoutElementBuilders.LayoutElement
Tiles component 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 ProgressIndicatorDefaults. Unless specified, the CircularProgressIndicator will have the full length.
The recommended set of ProgressIndicatorColors can be obtained from ProgressIndicatorDefaults, 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);
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 |
|---|
public final class CircularProgressIndicator.Builder implements LayoutElementBuilders.LayoutElement.BuilderBuilder class for |
Public methods |
|
|---|---|
static @Nullable CircularProgressIndicator |
Returns CircularProgressIndicator object from the given androidx.wear.tiles.LayoutElementBuilders.LayoutElement (e.g. one retrieved from a container's content with |
@NonNull ProgressIndicatorColors |
Returns main arc color of this CircularProgressIndicator. |
@Nullable CharSequence |
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. |
Public methods
public static @Nullable CircularProgressIndicatorfromLayoutElement(@NonNull LayoutElementBuilders.LayoutElement element)
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.
public @NonNull ProgressIndicatorColorsgetCircularProgressIndicatorColors()
Returns main arc color of this CircularProgressIndicator.
public @Nullable CharSequencegetContentDescription()
Returns content description of this CircularProgressIndicator.
public @NonNull DimensionBuilders.DegreesPropgetEndAngle()
Returns start angle of this CircularProgressIndicator.
public @NonNull DimensionBuilders.DegreesPropgetProgress()
Returns angle representing progressed part of this CircularProgressIndicator.
public @NonNull DimensionBuilders.DegreesPropgetStartAngle()
Returns start angle of this CircularProgressIndicator.
public @NonNull DimensionBuilders.DpPropgetStrokeWidth()
Returns stroke width of this CircularProgressIndicator.