ChipStyle.Builder


class ChipStyle.Builder


A builder of ChipStyle.

Summary

Public constructors

Public functions

ChipStyle

Constructs the ChipStyle defined by this builder.

ChipStyle.Builder
setBackgroundColor(backgroundColor: CarColor)

Sets the background color of the chip.

ChipStyle.Builder
setContentColor(contentColor: CarColor)

Sets the content color of the chip.

ChipStyle.Builder
setOutlineColor(outlineColor: CarColor)

Sets the stroke color of the chip.

Public constructors

Builder

Added in 1.8.0-beta01
Builder()

Public functions

build

Added in 1.8.0-beta01
fun build(): ChipStyle

Constructs the ChipStyle defined by this builder.

setBackgroundColor

Added in 1.8.0-beta01
fun setBackgroundColor(backgroundColor: CarColor): ChipStyle.Builder

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
fun setContentColor(contentColor: CarColor): ChipStyle.Builder

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
fun setOutlineColor(outlineColor: CarColor): ChipStyle.Builder

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