ChipSection.Builder


class ChipSection.Builder : Section.BaseBuilder


A builder of ChipSection.

Summary

Public constructors

Creates a new instance of the builder.

Public functions

ChipSection

Constructs the ChipSection defined by this builder.

ChipSection.Builder

Sets the style for all chips in this section.

Inherited functions

From androidx.car.app.model.Section.BaseBuilder
B

Adds an item to this section, appending to the existing list of items.

B

Delete all items in this section.

B

Sets the items for this section, overwriting any other previously set items.

B

Sets or clears the optional message to display in this section when there are 0 items added to it.

B

Sets or clears the optional message to display in this section when there are 0 items added to it.

B

Sets the OnItemVisibilityChangedListener to call when the visible items in this Section changes.

B

Sets or clears the optional title that appears above the items in this section.

B

Sets or clears the optional title that appears above the items in this section.

Public constructors

Builder

Added in 1.8.0-beta01
Builder()

Creates a new instance of the builder.

Public functions

build

Added in 1.8.0-beta01
fun build(): ChipSection

Constructs the ChipSection defined by this builder.

Throws
java.lang.IllegalArgumentException

if the section does not contain at least one item.

setStyle

Added in 1.8.0-beta01
fun setStyle(style: ChipStyle): ChipSection.Builder

Sets the style for all chips in this section.

Any fields not explicitly set here or in the individual chip styling of setStyle will fall back to host defaults. If the colors do not meet the contrast requirements, the host will set the chip styling to defaults based on the setSelected state.

Throws
java.lang.NullPointerException

if style is null