Section
@CarProtocol
@RequiresCarApi(value = 8)
public abstract class Section<T extends Item>
BannerSection |
A section within the |
ChipSection |
A section of |
CondensedSection |
A |
GridSection |
A section within the |
RowSection |
A section within the |
SpotlightSection |
A section within the |
The generic interface for a single section within a sectioned item template. Sections only allow a single type of Item to be added.
Summary
Nested types |
|---|
protected abstract class Section.BaseBuilder<T extends Item, B>Generic |
Protected constructors |
|---|
Section() |
Section(@NonNull Section.BaseBuilder<T, @NonNull ?> builder)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 |
@Nullable SectionHeader |
@RequiresCarApi(value = 9)Returns the |
@Nullable CarText |
getTitle()Returns the optional text that should appear with the items in this section. |
int |
hashCode() |
@NonNull String |
toString() |
Protected constructors
Section
protected Section(@NonNull Section.BaseBuilder<T, @NonNull ?> builder)
Constructor that fills out fields from any section builder.
Public methods
getNoItemsMessage
public @Nullable CarText getNoItemsMessage()
Returns the optional message that should appear if there are no items added to this section.
getOnItemVisibilityChangedDelegate
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
@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
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.