ArrayObjectAdapter
open class ArrayObjectAdapter : ObjectAdapter
kotlin.Any | ||
↳ | androidx.leanback.widget.ObjectAdapter | |
↳ | androidx.leanback.widget.ArrayObjectAdapter |
An ObjectAdapter
implemented with an ArrayList
.
Summary
Inherited constants | |
---|---|
Public constructors | |
---|---|
<init>(presenterSelector: PresenterSelector!) Constructs an adapter with the given |
|
Constructs an adapter that uses the given |
|
<init>() Constructs an adapter. |
Public methods | |
---|---|
open Unit |
Adds an item to the end of the adapter. |
open Unit |
Inserts an item into this adapter at the specified index. |
open Unit |
addAll(index: Int, items: MutableCollection<Any?>!) Adds the objects in the given collection to the adapter, starting at the given index. |
open Unit |
clear() Removes all items from this adapter, leaving it empty. |
open Any! | |
open Int |
Returns the index for the first occurrence of item in the adapter, or -1 if not found. |
open Boolean | |
open Unit |
Moved the item at fromPosition to toPosition. |
open Unit |
notifyArrayItemRangeChanged(positionStart: Int, itemCount: Int) Notify that the content of a range of items changed. |
open Boolean |
Removes the first occurrence of the given item from the adapter. |
open Int |
removeItems(position: Int, count: Int) Removes a range of items from the adapter. |
open Unit |
Replaces item at position with a new item and calls notifyItemRangeChanged() at the given position. |
open Unit |
setItems(itemList: MutableList<Any?>!, callback: DiffCallback<Any!>!) Set a new item list to adapter. |
open Int |
size() |
open MutableList<E>! |
Gets a read-only view of the list of object of this ArrayObjectAdapter. |
Inherited functions | |
---|---|
Public constructors
<init>
ArrayObjectAdapter(presenterSelector: PresenterSelector!)
Constructs an adapter with the given PresenterSelector
.
<init>
ArrayObjectAdapter(presenter: Presenter!)
Constructs an adapter that uses the given Presenter
for all items.
<init>
ArrayObjectAdapter()
Constructs an adapter.
Public methods
add
open fun add(item: Any!): Unit
Adds an item to the end of the adapter.
Parameters | |
---|---|
item |
Any!: The item to add to the end of the adapter. |