public final class

CircularProgressIndicator.Builder

extends java.lang.Object

implements LayoutElementBuilders.LayoutElement.Builder

 java.lang.Object

↳androidx.wear.protolayout.material.CircularProgressIndicator.Builder

Overview

Builder class for CircularProgressIndicator

Summary

Constructors
publicBuilder()

Creates a builder for the CircularProgressIndicator.

Methods
public CircularProgressIndicatorbuild()

Constructs and returns CircularProgressIndicator with the provided field and look.

public CircularProgressIndicator.BuildersetCircularProgressIndicatorColors(ProgressIndicatorColors circularProgressIndicatorColors)

Sets the colors for the CircularProgressIndicator.

public CircularProgressIndicator.BuildersetContentDescription(java.lang.CharSequence contentDescription)

Sets the static content description of the CircularProgressIndicator to be used for accessibility support.

public CircularProgressIndicator.BuildersetContentDescription(TypeBuilders.StringProp contentDescription)

Sets the content description of the CircularProgressIndicator to be used for accessibility support.

public CircularProgressIndicator.BuildersetEndAngle(float endAngle)

Sets the end angle of the CircularProgressIndicator's background arc, where angle 0 is 12 o'clock.

public CircularProgressIndicator.BuildersetOuterMarginApplied(boolean isApplied)

Sets whether this CircularProgressIndicator should have outer margin or not.

public CircularProgressIndicator.BuildersetProgress(float progressRatio)

Sets the progress of the CircularProgressIndicator.

public CircularProgressIndicator.BuildersetProgress(TypeBuilders.FloatProp progressRatio)

Sets the progress of the CircularProgressIndicator.

public CircularProgressIndicator.BuildersetStartAngle(float startAngle)

Sets the start angle of the CircularProgressIndicator's background arc, where angle 0 is 12 o'clock.

public CircularProgressIndicator.BuildersetStrokeWidth(DimensionBuilders.DpProp strokeWidth)

Sets the stroke width of the CircularProgressIndicator.

public CircularProgressIndicator.BuildersetStrokeWidth(float strokeWidth)

Sets the stroke width of the CircularProgressIndicator.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder()

Creates a builder for the CircularProgressIndicator.

Methods

public CircularProgressIndicator.Builder setProgress(float progressRatio)

Sets the progress of the CircularProgressIndicator. Progress ratio should be a value between 0 and 1. If not set, 0 will be used. Progress will be colored in ProgressIndicatorColors.getIndicatorColor().

Sets the progress of the CircularProgressIndicator. If not set, static value provided using CircularProgressIndicator.Builder.setProgress(float) will be used, or 0. Progress will be colored in 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: 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.

public CircularProgressIndicator.Builder setStartAngle(float startAngle)

Sets the start angle of the 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.

public CircularProgressIndicator.Builder setEndAngle(float endAngle)

Sets the end angle of the 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.

public CircularProgressIndicator.Builder setContentDescription(java.lang.CharSequence contentDescription)

Sets the static content description of the CircularProgressIndicator to be used for accessibility support.

public CircularProgressIndicator.Builder setContentDescription(TypeBuilders.StringProp contentDescription)

Sets the content description of the 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).

public CircularProgressIndicator.Builder setCircularProgressIndicatorColors(ProgressIndicatorColors circularProgressIndicatorColors)

Sets the colors for the CircularProgressIndicator. If set, ProgressIndicatorColors.getIndicatorColor() will be used for a progress that has been made, while ProgressIndicatorColors.getTrackColor() will be used for a background full size arc. If not set, ProgressIndicatorDefaults.DEFAULT_COLORS will be used.

Sets the stroke width of the CircularProgressIndicator. Strongly recommended value is ProgressIndicatorDefaults.DEFAULT_STROKE_WIDTH.

public CircularProgressIndicator.Builder setStrokeWidth(float strokeWidth)

Sets the stroke width of the CircularProgressIndicator. Strongly recommended value is ProgressIndicatorDefaults.DEFAULT_STROKE_WIDTH.

public CircularProgressIndicator.Builder setOuterMarginApplied(boolean isApplied)

Sets whether this 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 EdgeContentLayout, it's strongly recommended to set this to true.

If not set, defaults to true.

Constructs and returns CircularProgressIndicator with the provided field and look.