BannerSection.Builder


public final class BannerSection.Builder extends Section.BaseBuilder


A builder that constructs BannerSection instances.

Summary

Public constructors

Create a new BannerSection builder.

Public methods

@NonNull BannerSection

Constructs a new BannerSection from the current state of this builder, throwing exceptions for any invalid state.

Inherited methods

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

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

@NonNull B

Delete all items in this section.

@NonNull B

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

@NonNull B

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

@NonNull B

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

@NonNull B

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

@NonNull B

Sets the SectionHeader for this section.

@NonNull B

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

@NonNull B

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

Public constructors

Builder

Added in 1.8.0
public Builder()

Create a new BannerSection builder.

Public methods

build

Added in 1.8.0
public @NonNull BannerSection build()

Constructs a new BannerSection from the current state of this builder, throwing exceptions for any invalid state.

Upon building, this class validates that exactly one Banner is present.

Throws
java.lang.IllegalStateException

if the section does not contain exactly one Banner