ListTemplate

@CarProtocol
public final class ListTemplate implements Template


A template representing a list of items.

Template Restrictions In regards to template refreshes, as described in onGetTemplate, 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 ItemList structure between the templates have not changed. This means that if the previous template has multiple ItemList sections, 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.Builder

A builder of ListTemplate.

Public methods

boolean
@Nullable ActionStrip

Returns the ActionStrip for this template or null if not set.

@NonNull List<Action>
@RequiresCarApi(value = 6)
getActions()

Returns the list of additional actions.

@Nullable Action

Returns the Action that is set to be displayed in the header of the template, or null if not set.

@NonNull List<SectionedItemList>

Returns the list of SectionedItemList instances to be displayed in the template.

@Nullable ItemList

Returns the ItemList instance containing the list of items to display or null if one hasn't been set.

@Nullable CarText

Returns the title of the template or null if not set.

int
boolean

Returns whether the template is loading.

@NonNull ListTemplate.Builder

Creates and returns a new Builder initialized with this ListTemplate's data.

@NonNull String

Public methods

equals

Added in 1.4.0-rc02
public boolean equals(@Nullable Object other)

getActionStrip

Added in 1.0.0
public @Nullable ActionStrip getActionStrip()

Returns the ActionStrip for this template or null if not set.

See also
setActionStrip

getActions

Added in 1.4.0-rc02
@RequiresCarApi(value = 6)
public @NonNull List<ActiongetActions()

Returns the list of additional actions.

See also
addAction

getHeaderAction

Added in 1.0.0
public @Nullable Action getHeaderAction()

Returns the Action that is set to be displayed in the header of the template, or null if not set.

See also
setHeaderAction

getSectionedLists

Added in 1.0.0
public @NonNull List<SectionedItemListgetSectionedLists()

Returns the list of SectionedItemList instances to be displayed in the template.

See also
addSectionedList

getSingleList

Added in 1.0.0
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

getTitle

Added in 1.0.0
public @Nullable CarText getTitle()

Returns the title of the template or null if not set.

See also
setTitle

hashCode

Added in 1.4.0-rc02
public int hashCode()

isLoading

Added in 1.0.0
public boolean isLoading()

Returns whether the template is loading.

See also
setLoading

toBuilder

Added in 1.3.0
@ExperimentalCarApi
public @NonNull ListTemplate.Builder toBuilder()

Creates and returns a new Builder initialized with this ListTemplate's data.

toString

Added in 1.4.0-rc02
public @NonNull String toString()