ListTemplate
@CarProtocol
public final class ListTemplate implements Template
A template representing a list of items.
Template Restrictions In regards to template refreshes, as described inonGetTemplate, this template is considered a refresh of a previous one if:
- The previous template is in a loading state (see
setLoading}, or - The template title has not changed, and the
ItemListstructure between the templates have not changed. This means that if the previous template has multipleItemListsections, the new template must have the same number of sections with the same headers. Further, the number of rows and the title (not counting spans) of each row must not have changed. - For rows that contain a
Toggle, updates to the title are also allowed if the toggle state has changed between the previous and new templates.
Summary
Nested types |
|---|
public final class ListTemplate.BuilderA builder of |
Public methods |
|
|---|---|
boolean |
|
@Nullable ActionStrip |
This method is deprecated. use |
@NonNull List<Action> |
@RequiresCarApi(value = 6)Returns the list of additional actions. |
@Nullable Header |
Returns the |
@Nullable Action |
This method is deprecated. use |
@NonNull List<SectionedItemList> |
Returns the list of |
@Nullable ItemList |
Returns the |
@Nullable CarText |
This method is deprecated. use |
int |
hashCode() |
boolean |
Returns whether the template is loading. |
@NonNull ListTemplate.Builder |
Creates and returns a new |
@NonNull String |
toString() |
Public methods
public @Nullable ActionStripgetActionStrip()
Returns the ActionStrip for this template or null if not set.
| See also | |
|---|---|
setActionStrip |
getActions
@RequiresCarApi(value = 6)
public @NonNull List<Action> getActions()
Returns the list of additional actions.
| See also | |
|---|---|
addAction |
getHeader
public @Nullable Header getHeader()
Returns the Header to display in this template.
This method was introduced in API 7, but is backwards compatible even if the client is using API 6 or below.
| See also | |
|---|---|
setHeader |
public @Nullable ActiongetHeaderAction()
Returns the Action that is set to be displayed in the header of the template, or null if not set.
| See also | |
|---|---|
setHeaderAction |
getSectionedLists
public @NonNull List<SectionedItemList> getSectionedLists()
Returns the list of SectionedItemList instances to be displayed in the template.
| See also | |
|---|---|
addSectionedList |
getSingleList
public @Nullable ItemList getSingleList()
Returns the ItemList instance containing the list of items to display or
null if one hasn't been set.
| See also | |
|---|---|
setSingleList |
public @Nullable CarTextgetTitle()
Returns the title of the template or null if not set.
| See also | |
|---|---|
setTitle |
isLoading
public boolean isLoading()
Returns whether the template is loading.
| See also | |
|---|---|
setLoading |
toBuilder
@ExperimentalCarApi
public @NonNull ListTemplate.Builder toBuilder()
Creates and returns a new Builder initialized with this ListTemplate's data.