Section


@CarProtocol
@RequiresCarApi(value = 8)
public abstract class Section<T extends Item>

Known direct subclasses
BannerSection

A section within the SectionedItemTemplate that contains a Banner.

ChipSection

A section of Chips.

CondensedSection

A Section within the SectionedItemTemplate that contains CondensedItems.

GridSection

A section within the SectionedItemTemplate that contains GridItems - good for showcase large artwork or images for every entry.

RowSection

A section within the SectionedItemTemplate that contains Rows - good for showcasing small icons and longer text for every entry.

SpotlightSection

A section within the SectionedItemTemplate that contains a single image and multiple CondensedItems.


The generic interface for a single section within a sectioned item template. Sections only allow a single type of Item to be added.

Parameters
<T extends Item>

the type of Item that's allowed to be added to this section

Summary

Nested types

protected abstract class Section.BaseBuilder<T extends Item, B>

Generic Section builder that contains the fields that all sections share.

Protected constructors

Constructor that fills out fields from any section builder.

Public methods

boolean
@Nullable CarText

Returns the optional message that should appear if there are no items added to this section.

@Nullable OnItemVisibilityChangedDelegate

Returns the OnItemVisibilityChangedDelegate to be called when the visible items in this Section changes, or null if one isn't set.

@Nullable SectionHeader

Returns the SectionHeader for this section, or null if not set.

@Nullable CarText

Returns the optional text that should appear with the items in this section.

int
@NonNull String

Protected constructors

Section

Added in 1.7.0
protected Section()

Section

Added in 1.7.0
protected Section(@NonNull Section.BaseBuilder<T, Object> builder)

Constructor that fills out fields from any section builder.

Public methods

equals

public boolean equals(@Nullable Object other)

getNoItemsMessage

Added in 1.7.0
public @Nullable CarText getNoItemsMessage()

Returns the optional message that should appear if there are no items added to this section.

getOnItemVisibilityChangedDelegate

Added in 1.8.0
public @Nullable OnItemVisibilityChangedDelegate getOnItemVisibilityChangedDelegate()

Returns the OnItemVisibilityChangedDelegate to be called when the visible items in this Section changes, or null if one isn't set.

getSectionHeader

Added in 1.8.0
@RequiresCarApi(value = 9)
@ExperimentalCarApi
public @Nullable SectionHeader getSectionHeader()

Returns the SectionHeader for this section, or null if not set.

If this is set, it takes precedence over getTitle.

getTitle

Added in 1.7.0
public @Nullable CarText getTitle()

Returns the optional text that should appear with the items in this section.

If getSectionHeader is set, it takes precedence and this title should be ignored.

hashCode

public int hashCode()

toString

public @NonNull String toString()