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 Rows in a .

Summary

Nested types

public final class ItemList.Builder

A builder of ItemList.

A listener for handling item visibility changes.

A listener for handling selection events for lists with selectable items.

Public methods

boolean
@NonNull List<Item>

Returns the list of items in this ItemList.

@Nullable CarText

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.

@Nullable OnItemVisibilityChangedDelegate

Returns the OnItemVisibilityChangedDelegate to be called when the visible items in the list changes or null if one hasn't been set.

@Nullable OnSelectedDelegate

Returns the OnSelectedDelegate to be called when when an item is selected by the user or null is the list is non-selectable.

int

Returns the index of the selected item of the list.

int
@NonNull ItemList.Builder

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

@NonNull String

Public methods

equals

public boolean equals(@Nullable Object other)

getItems

Added in 1.0.0
public @NonNull List<ItemgetItems()

Returns the list of items in this ItemList.

See also
addItem

getNoItemsMessage

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

getOnItemVisibilityChangedDelegate

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

getOnSelectedDelegate

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

getSelectedIndex

Added in 1.0.0
public int getSelectedIndex()

Returns the index of the selected item of the list.

See also
setSelectedIndex

hashCode

public int hashCode()

toBuilder

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

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

toString

public @NonNull String toString()