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

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

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.