Section.BaseBuilder
protected abstract class Section.BaseBuilder<T : Item?, B>
GridSection.Builder |
A builder that constructs |
RowSection.Builder |
A builder that constructs |
Generic Section builder that contains the fields that all sections share.
| Parameters | |
|---|---|
<T : Item?> |
The |
<B> |
The builder type to return for the builder methods |
Summary
Protected constructors |
|---|
Public functions |
|
|---|---|
B |
@CanIgnoreReturnValueAdds an item to this section, appending to the existing list of items. |
B |
Delete all items in this section. |
B |
@CanIgnoreReturnValueSets the items for this section, overwriting any other previously set items. |
B |
@CanIgnoreReturnValueSets or clears the optional message to display in this section when there are 0 items added to it. |
B |
@CanIgnoreReturnValueSets or clears the optional message to display in this section when there are 0 items added to it. |
B |
@CanIgnoreReturnValueSets the |
B |
@CanIgnoreReturnValueSets or clears the optional title that appears above the items in this section. |
B |
@CanIgnoreReturnValueSets or clears the optional title that appears above the items in this section. |
Protected constructors
Public functions
addItem
@CanIgnoreReturnValue
fun addItem(item: T): B
Adds an item to this section, appending to the existing list of items.
clearItems
@CanIgnoreReturnValue
fun clearItems(): B
Delete all items in this section.
setItems
@CanIgnoreReturnValue
fun setItems(items: (Mutable)List<T!>): B
Sets the items for this section, overwriting any other previously set items.
setNoItemsMessage
@CanIgnoreReturnValue
fun setNoItemsMessage(noItemsMessage: CarText?): B
Sets or clears the optional message to display in this section when there are 0 items added to it. If not set, this section will not show any message when there are 0 items. The message must conform to TEXT_ONLY constraints.
setNoItemsMessage
@CanIgnoreReturnValue
fun setNoItemsMessage(noItemsMessage: CharSequence?): B
Sets or clears the optional message to display in this section when there are 0 items added to it. If not set, this section will not show any message when there are 0 items. The message must conform to TEXT_ONLY constraints.
setOnItemVisibilityChangedListener
@CanIgnoreReturnValue
fun setOnItemVisibilityChangedListener(
onItemVisibilityChangedListener: ItemList.OnItemVisibilityChangedListener?
): B
Sets the OnItemVisibilityChangedListener to call when the visible items in this Section changes.
Note that the listener relates to UI events and will be executed on the main thread using Looper#getMainLooper().
It's possible for more than 1 Section to be visible on the screen at the same time, in which case, every visible Section's OnItemVisibilityChangedListener will be triggered with their respective visible items.
Passing null will clear the OnItemVisibilityChangedListener.
setTitle
@CanIgnoreReturnValue
fun setTitle(title: CarText?): B
Sets or clears the optional title that appears above the items in this section. If not set, no title shows up. The title must conform to TEXT_ONLY constraints.
setTitle
@CanIgnoreReturnValue
fun setTitle(title: CharSequence?): B
Sets or clears the optional title that appears above the items in this section. If not set, no title shows up. The title must conform to TEXT_ONLY constraints.