RemoteViews.RemoteCollectionItems.Builder


public static final class RemoteViews.RemoteCollectionItems.Builder
extends Object

java.lang.Object
   ↳ android.widget.RemoteViews.RemoteCollectionItems.Builder


Builder class for RemoteCollectionItems objects.

Summary

Public constructors

Builder()

Public methods

RemoteViews.RemoteCollectionItems.Builder addItem(long id, RemoteViews view)

Adds a RemoteViews to the collection.

RemoteViews.RemoteCollectionItems build()

Creates the RemoteCollectionItems defined by this builder.

RemoteViews.RemoteCollectionItems.Builder setHasStableIds(boolean hasStableIds)

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

RemoteViews.RemoteCollectionItems.Builder setViewTypeCount(int viewTypeCount)

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

Inherited methods

Public constructors

Builder

public Builder ()

Public methods

addItem

Added in API level 31
public RemoteViews.RemoteCollectionItems.Builder addItem (long id, 
                RemoteViews view)

Adds a RemoteViews to the collection.

Parameters
id long: Id to associate with the row. Use setHasStableIds(boolean) to indicate that ids are stable across changes to the collection.

view RemoteViews: RemoteViews to display for the row. This value cannot be null.

Returns
RemoteViews.RemoteCollectionItems.Builder This value cannot be null.

build

Added in API level 31
public RemoteViews.RemoteCollectionItems build ()

Creates the RemoteCollectionItems defined by this builder.

Returns
RemoteViews.RemoteCollectionItems This value cannot be null.

setHasStableIds

Added in API level 31
public RemoteViews.RemoteCollectionItems.Builder setHasStableIds (boolean hasStableIds)

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

Parameters
hasStableIds boolean

Returns
RemoteViews.RemoteCollectionItems.Builder This value cannot be null.

setViewTypeCount

Added in API level 31
public RemoteViews.RemoteCollectionItems.Builder setViewTypeCount (int viewTypeCount)

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.

Parameters
viewTypeCount int

Returns
RemoteViews.RemoteCollectionItems.Builder This value cannot be null.