RemoteViewsCompat.RemoteCollectionItems.Builder


public final class RemoteViewsCompat.RemoteCollectionItems.Builder


Builder class for RemoteCollectionItems objects.

Summary

Public constructors

Public methods

final @NonNull RemoteViewsCompat.RemoteCollectionItems.Builder
addItem(long id, @NonNull RemoteViews view)

Adds a RemoteViews to the collection.

final @NonNull RemoteViewsCompat.RemoteCollectionItems

Creates the RemoteCollectionItems defined by this builder.

final @NonNull RemoteViewsCompat.RemoteCollectionItems.Builder
setHasStableIds(boolean hasStableIds)

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

final @NonNull RemoteViewsCompat.RemoteCollectionItems.Builder
setViewTypeCount(int viewTypeCount)

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

Public constructors

Builder

Added in 1.0.0
public Builder()

Public methods

addItem

Added in 1.0.0
public final @NonNull RemoteViewsCompat.RemoteCollectionItems.Builder addItem(long id, @NonNull RemoteViews view)

Adds a RemoteViews to the collection.

Parameters
long id

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

@NonNull RemoteViews view

RemoteViews to display for the row.

build

Added in 1.0.0
public final @NonNull RemoteViewsCompat.RemoteCollectionItems build()

Creates the RemoteCollectionItems defined by this builder.

setHasStableIds

Added in 1.0.0
public final @NonNull RemoteViewsCompat.RemoteCollectionItems.Builder setHasStableIds(boolean hasStableIds)

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

See also
hasStableIds

setViewTypeCount

Added in 1.0.0
public final @NonNull RemoteViewsCompat.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.

See also
getViewTypeCount