Google se compromete a impulsar la igualdad racial para las comunidades afrodescendientes. Obtén información al respecto.

ObjectAdapter

abstract class ObjectAdapter
kotlin.Any
   ↳ androidx.leanback.widget.ObjectAdapter

Base class adapter to be used in leanback activities. Provides access to a data model and is decoupled from the presentation of the items via PresenterSelector.

Summary

Nested classes
abstract

A DataObserver can be notified when an ObjectAdapter's underlying data changes.

Constants
static Int

Indicates that an id has not been set.

Public constructors
<init>(presenterSelector: PresenterSelector!)

Constructs an adapter with the given PresenterSelector.

<init>(presenter: Presenter!)

Constructs an adapter that uses the given Presenter for all items.

Constructs an adapter.

Public methods
abstract Any!
get(position: Int)

Returns the item for the given position.

open Long
getId(position: Int)

Returns the id for the given position.

Presenter!
getPresenter(item: Any!)

Returns the Presenter for the given item from the adapter.

PresenterSelector!

Returns the presenter selector for this ObjectAdapter.

Boolean

Returns true if the item ids are stable across changes to the underlying data.

open Boolean

Returns true if the adapter pairs each underlying data change with a call to notify and false otherwise.

Unit
notifyItemRangeChanged(positionStart: Int, itemCount: Int)

Notifies UI that some items has changed.

Unit
notifyItemRangeChanged(positionStart: Int, itemCount: Int, payload: Any!)

Notifies UI that some items has changed.

Unit

Registers a DataObserver for data change notifications.

Unit
setHasStableIds(hasStableIds: Boolean)

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

Unit

Sets the presenter selector.

abstract Int

Returns the number of items in the adapter.

Unit

Unregisters all DataObservers for this ObjectAdapter.

Unit

Unregisters a DataObserver for data change notifications.

Protected methods
Unit

Notifies UI that the underlying data has changed.

Unit
notifyItemMoved(fromPosition: Int, toPosition: Int)

Notifies UI that item at fromPosition has been moved to toPosition.

Unit
notifyItemRangeInserted(positionStart: Int, itemCount: Int)

Notifies UI that new items has been inserted.

Unit
notifyItemRangeRemoved(positionStart: Int, itemCount: Int)

Notifies UI that some items that has been removed.

open Unit

Called when setHasStableIds(boolean) is called