CarProgressBar.Builder


public final class CarProgressBar.Builder


A builder of CarProgressBar.

Summary

Public constructors

Builder(@FloatRange(from = 0.0, to = 1.0) float progress)

Creates a builder with the specified progress.

Public methods

@NonNull CarProgressBar

Constructs the CarProgressBar defined by this builder.

@NonNull CarProgressBar.Builder

Sets the color of the progress bar.

Public constructors

Builder

Added in 1.8.0-beta01
public Builder(@FloatRange(from = 0.0, to = 1.0) float progress)

Creates a builder with the specified progress.

Values outside the range [0.0, 1.0] will be coerced to the nearest bound.

Parameters
@FloatRange(from = 0.0, to = 1.0) float progress

the progress, from 0.0 to 1.0

Throws
java.lang.IllegalArgumentException

if progress is NaN or infinite

Public methods

build

Added in 1.8.0-beta01
public @NonNull CarProgressBar build()

Constructs the CarProgressBar defined by this builder.

setColor

Added in 1.8.0-beta01
public @NonNull CarProgressBar.Builder setColor(@NonNull CarColor color)

Sets the color of the progress bar.

If a color is not set, or if the provided color does not pass a contrast check, the host will use a default color.

Throws
java.lang.NullPointerException

if color is null