ItemList
@CarProtocol
public final class ItemList
Represents a list of Item
instances. ItemList
instances are used by templates that contain lists of models, such as for example, the list of Row
s in a .
Summary
Nested types |
---|
public final class ItemList.Builder A builder of |
public interface ItemList.OnItemVisibilityChangedListener A listener for handling item visibility changes. |
public interface ItemList.OnSelectedListener A listener for handling selection events for lists with selectable items. |
Public methods |
|
---|---|
boolean |
|
@NonNull List<Item> |
getItems() Returns the list of items in this |
@Nullable CarText |
Returns the app-supplied text to be displayed if the list is empty or |
@Nullable OnItemVisibilityChangedDelegate |
Returns the |
@Nullable OnSelectedDelegate |
Returns the |
int |
Returns the index of the selected item of the list. |
int |
hashCode() |
@NonNull ItemList.Builder |
Creates and returns a new |
@NonNull String |
toString() |
Public methods
getItems
public @NonNull List<Item> getItems()
Returns the list of items in this ItemList
.
See also | |
---|---|
addItem |
getNoItemsMessage
public @Nullable CarText getNoItemsMessage()
Returns the app-supplied text to be displayed if the list is empty or null
if the default text will be used by the host.
See also | |
---|---|
setNoItemsMessage |
getOnItemVisibilityChangedDelegate
public @Nullable OnItemVisibilityChangedDelegate getOnItemVisibilityChangedDelegate()
Returns the OnItemVisibilityChangedDelegate
to be called when the visible items in the list changes or null
if one hasn't been set.
See also | |
---|---|
setOnItemsVisibilityChangedListener |
getOnSelectedDelegate
public @Nullable OnSelectedDelegate getOnSelectedDelegate()
Returns the OnSelectedDelegate
to be called when when an item is selected by the user or null
is the list is non-selectable.
See also | |
---|---|
setOnSelectedListener |
getSelectedIndex
public int getSelectedIndex()
Returns the index of the selected item of the list.
See also | |
---|---|
setSelectedIndex |
toBuilder
@ExperimentalCarApi
public @NonNull ItemList.Builder toBuilder()
Creates and returns a new Builder
initialized with this ItemList
's data.