ListTemplate
public
final
class
ListTemplate
extends Object
implements
Template
java.lang.Object | |
↳ | androidx.car.app.model.ListTemplate |
A template representing a list of items.
Template Restrictions
In regards to template refreshes, as described inScreen.onGetTemplate()
, this
template is considered a refresh of a previous one if:
- The template title has not changed, and
- The previous template is in a loading state (see
ListTemplate.Builder.setLoading(boolean)
}, or theItemList
structure between the templates have not changed. This means that if the previous template has multipleItemList
sections, the new template must have the same number of sections with the same headers. Further, the number of rows and the string contents (title, texts, not counting spans) of each row must not have changed. - For rows that contain a
Toggle
, updates to the title or texts are also allowed if the toggle state has changed between the previous and new templates.
Summary
Nested classes | |
---|---|
class |
ListTemplate.Builder
A builder of |
Public methods | |
---|---|
boolean
|
equals(Object other)
|
ActionStrip
|
getActionStrip()
Returns the |
Action
|
getHeaderAction()
Returns the |
List<SectionedItemList>
|
getSectionedLists()
Returns the list of |
ItemList
|
getSingleList()
Returns the |
CarText
|
getTitle()
Returns the title of the template or |
int
|
hashCode()
|
boolean
|
isLoading()
Returns whether the template is loading. |
String
|
toString()
|
Inherited methods | |
---|---|
Public methods
equals
public boolean equals (Object other)
Parameters | |
---|---|
other |
Object |
Returns | |
---|---|
boolean |
getActionStrip
public ActionStrip getActionStrip ()
Returns the ActionStrip
for this template or null
if not set.
Returns | |
---|---|
ActionStrip |
getHeaderAction
public Action getHeaderAction ()
Returns the Action
that is set to be displayed in the header of the template, or
null
if not set.
Returns | |
---|---|
Action |
getSectionedLists
public List<SectionedItemList> getSectionedLists ()
Returns the list of SectionedItemList
instances to be displayed in the template.
Returns | |
---|---|
List<SectionedItemList> |
getSingleList
public ItemList getSingleList ()
Returns the ItemList
instance containing the list of items to display or null
if one hasn't been set.
Returns | |
---|---|
ItemList |
getTitle
public CarText getTitle ()
Returns the title of the template or null
if not set.
Returns | |
---|---|
CarText |
hashCode
public int hashCode ()
Returns | |
---|---|
int |
isLoading
public boolean isLoading ()
Returns whether the template is loading.
Returns | |
---|---|
boolean |
See also:
toString
public String toString ()
Returns | |
---|---|
String |
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2021-02-24 UTC.