Class

RemoteCollectionItems.Builder

Builder class for RemoteCollectionItems objects.

Android
class Builder

Builder class for RemoteCollectionItems objects.

Functions

addItem

@SuppressLint("MissingGetterMatchingBuilder")
        fun addItem(id: Long, view: RemoteViews): Builder

Adds a RemoteViews to the collection.

Parameters

id Id to associate with the row. Use [.setHasStableIds] to indicate that ids are stable across changes to the collection.
view RemoteViews to display for the row.

setHasStableIds

fun setHasStableIds(hasStableIds: Boolean): Builder

Sets whether the item ids are stable across changes to the underlying data.


setViewTypeCount

fun setViewTypeCount(viewTypeCount: Int): Builder

Sets the view type count for the collection when used in an adapter. This can be set to the maximum number of different layout ids that will be used by RemoteViews in this collection.

If this value is not set, then a value will be inferred from the provided items. As a result, the adapter may need to be recreated when the list is updated with previously unseen RemoteViews layouts for new items.


build

fun build(): RemoteCollectionItems

Creates the RemoteCollectionItems defined by this builder.