CircularProgressIndicator.Builder

Added in 1.1.0
Deprecated in 1.2.0

public final class CircularProgressIndicator.Builder implements LayoutElementBuilders.LayoutElement.Builder


Builder class for CircularProgressIndicator

Summary

Public constructors

Creates a builder for the CircularProgressIndicator.

Public methods

@NonNull CircularProgressIndicator

Constructs and returns CircularProgressIndicator with the provided field and look.

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

Sets the colors for the CircularProgressIndicator.

@NonNull CircularProgressIndicator.Builder

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

@NonNull CircularProgressIndicator.Builder
setEndAngle(float endAngle)

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

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

Sets the progress of the CircularProgressIndicator.

@NonNull CircularProgressIndicator.Builder
setStartAngle(float startAngle)

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

@NonNull CircularProgressIndicator.Builder

Sets the stroke width of the CircularProgressIndicator.

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

Sets the stroke width of the CircularProgressIndicator.

Public constructors

Builder

Added in 1.1.0
Deprecated in 1.2.0
public Builder()

Creates a builder for the CircularProgressIndicator.

Public methods

build

Added in 1.1.0
Deprecated in 1.2.0
public @NonNull CircularProgressIndicator build()

Constructs and returns CircularProgressIndicator with the provided field and look.

setCircularProgressIndicatorColors

Added in 1.1.0
Deprecated in 1.2.0
public @NonNull CircularProgressIndicator.Builder setCircularProgressIndicatorColors(
    @NonNull ProgressIndicatorColors circularProgressIndicatorColors
)

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

setContentDescription

Added in 1.1.0
Deprecated in 1.2.0
public @NonNull CircularProgressIndicator.Builder setContentDescription(@NonNull CharSequence contentDescription)

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

setEndAngle

Added in 1.1.0
Deprecated in 1.2.0
public @NonNull 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.

setProgress

Added in 1.1.0
Deprecated in 1.2.0
public @NonNull CircularProgressIndicator.Builder setProgress(@FloatRange(from = 0, to = 1) float progressPercentage)

Sets the progress of the CircularProgressIndicator. Progress should be percentage from 0 to 1. Progress will be colored in getTrackColor. If not set, 0 will be used.

setStartAngle

Added in 1.1.0
Deprecated in 1.2.0
public @NonNull 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.

setStrokeWidth

Added in 1.1.0
Deprecated in 1.2.0
public @NonNull CircularProgressIndicator.Builder setStrokeWidth(@NonNull DimensionBuilders.DpProp strokeWidth)

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

setStrokeWidth

Added in 1.1.0
Deprecated in 1.2.0
public @NonNull CircularProgressIndicator.Builder setStrokeWidth(@Dimension(unit = 0) float strokeWidth)

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