ChipStyle.Builder


public final class ChipStyle.Builder


A builder of ChipStyle.

Summary

Public constructors

Public methods

@NonNull ChipStyle

Constructs the ChipStyle defined by this builder.

@NonNull ChipStyle.Builder

Sets the background color of the chip.

@NonNull ChipStyle.Builder

Sets the content color of the chip.

@NonNull ChipStyle.Builder

Sets the stroke color of the chip.

Public constructors

Builder

Added in 1.8.0-beta01
public Builder()

Public methods

build

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

Constructs the ChipStyle defined by this builder.

setBackgroundColor

Added in 1.8.0-beta01
public @NonNull ChipStyle.Builder setBackgroundColor(@NonNull CarColor backgroundColor)

Sets the background color of the chip.

If the background color is not set, a host default color will be used, depending on the isSelected state.

@throws NullPointerException if backgroundColor is null

setContentColor

Added in 1.8.0-beta01
public @NonNull ChipStyle.Builder setContentColor(@NonNull CarColor contentColor)

Sets the content color of the chip.

If the content color is not set, a host default color will be used, depending on the isSelected state.

The content color is used for the text and icons within the chip.

This color is contrast checked against the background color. If it does not meet a minimum contrast threshold, this color will be ignored and a host-provided fallback color will be used.

Throws
java.lang.NullPointerException

if contentColor is null

setOutlineColor

Added in 1.8.0-beta01
public @NonNull ChipStyle.Builder setOutlineColor(@NonNull CarColor outlineColor)

Sets the stroke color of the chip.

If the content color is not set, a host default color will be used.

@throws NullPointerException if strokeColor is null