ItemList.Builder

public static final class ItemList.Builder
extends Object

java.lang.Object
   ↳ androidx.car.app.model.ItemList.Builder


A builder of ItemList.

Summary

Public constructors

Builder()

Returns an empty ItemList.Builder instance.

Public methods

ItemList.Builder addItem(Item item)

Adds an item to the list.

ItemList build()

Constructs the item list defined by this builder.

ItemList.Builder setNoItemsMessage(CharSequence noItemsMessage)

Sets the text to display if the list is empty.

ItemList.Builder setOnItemsVisibilityChangedListener(ItemList.OnItemVisibilityChangedListener itemVisibilityChangedListener)

Sets the ItemList.OnItemVisibilityChangedListener to call when the visible items in the list changes.

ItemList.Builder setOnSelectedListener(ItemList.OnSelectedListener onSelectedListener)

Marks the list as selectable by setting the ItemList.OnSelectedListener to call when an item is selected by the user, or set to null to mark the list as non-selectable.

ItemList.Builder setSelectedIndex(int selectedIndex)

Sets the index of the item to show as selected.

Inherited methods