SparseArrayObjectAdapter
open class SparseArrayObjectAdapter : ObjectAdapter
kotlin.Any | ||
↳ | androidx.leanback.widget.ObjectAdapter | |
↳ | androidx.leanback.widget.SparseArrayObjectAdapter |
An ObjectAdapter
implemented with a android.util.SparseArray
. This class maintains an array of objects where each object is associated with an integer key which determines its order relative to other objects.
Summary
Inherited constants | |
---|---|
Public constructors | |
---|---|
<init>(presenterSelector: PresenterSelector!) Constructs an adapter with the given |
|
Constructs an adapter with the given |
|
<init>() Constructs an adapter. |
Public methods | |
---|---|
open Unit |
Clears the given key and associated item from the adapter. |
open Unit |
clear() Removes all items from this adapter, leaving it empty. |
open Any! | |
open Int |
Returns the index for the given item in the adapter. |
open Int |
Returns the index for the given key in the adapter. |
open Boolean | |
open Any! |
Returns the object for the given key, or null if no mapping for that key exists. |
open Unit |
notifyArrayItemRangeChanged(positionStart: Int, itemCount: Int) Notify that the content of a range of items changed. |
open Unit |
Sets the item for the given key. |
open Int |
size() |
Inherited functions | |
---|---|
Public constructors
<init>
SparseArrayObjectAdapter(presenterSelector: PresenterSelector!)
Constructs an adapter with the given PresenterSelector
.
<init>
SparseArrayObjectAdapter(presenter: Presenter!)
Constructs an adapter with the given Presenter
.
<init>
SparseArrayObjectAdapter()
Constructs an adapter.
Public methods
clear
open fun clear(key: Int): Unit
Clears the given key and associated item from the adapter.
Parameters | |
---|---|
key |
Int: The key to be cleared. |
indexOf
open fun indexOf(item: Any!): Int
Returns the index for the given item in the adapter.
Parameters | |
---|---|
item |
Any!: The item to find in the array. |
Return | |
---|---|
Int |
Index of the item, or a negative value if not found. |
indexOf
open fun indexOf(key: Int): Int
Returns the index for the given key in the adapter.
Parameters | |
---|---|
key |
Int: The key to find in the array. |
Return | |
---|---|
Int |
Index of the item, or a negative value if not found. |
isImmediateNotifySupported
open fun isImmediateNotifySupported(): Boolean
lookup
open fun lookup(key: Int): Any!
Returns the object for the given key, or null if no mapping for that key exists.