RemoteViewsCompat.RemoteCollectionItems.Builder


class RemoteViewsCompat.RemoteCollectionItems.Builder


Builder class for RemoteCollectionItems objects.

Summary

Public constructors

Public functions

RemoteViewsCompat.RemoteCollectionItems.Builder
addItem(id: Long, view: RemoteViews)

Adds a RemoteViews to the collection.

RemoteViewsCompat.RemoteCollectionItems

Creates the RemoteCollectionItems defined by this builder.

RemoteViewsCompat.RemoteCollectionItems.Builder
setHasStableIds(hasStableIds: Boolean)

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

RemoteViewsCompat.RemoteCollectionItems.Builder
setViewTypeCount(viewTypeCount: Int)

Sets the view type count for the collection when used in an adapter.

Public constructors

Builder

Added in 1.0.0
Builder()

Public functions

addItem

Added in 1.0.0
fun addItem(id: Long, view: RemoteViews): RemoteViewsCompat.RemoteCollectionItems.Builder

Adds a RemoteViews to the collection.

Parameters
id: Long

Id to associate with the row. Use .setHasStableIds to indicate that ids are stable across changes to the collection.

view: RemoteViews

RemoteViews to display for the row.

build

Added in 1.0.0
fun build(): RemoteViewsCompat.RemoteCollectionItems

Creates the RemoteCollectionItems defined by this builder.

setHasStableIds

Added in 1.0.0
fun setHasStableIds(hasStableIds: Boolean): RemoteViewsCompat.RemoteCollectionItems.Builder

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

See also
hasStableIds

setViewTypeCount

Added in 1.0.0
fun setViewTypeCount(viewTypeCount: Int): RemoteViewsCompat.RemoteCollectionItems.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.

See also
getViewTypeCount