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 |
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 Unit |
setItems(itemList: MutableList<Any?>!, callback: DiffCallback<Any!>!) Set a new item list to adapter. |
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 |
Replaces item at position with a new item and calls notifyItemRangeChanged() at the given position. |
open Int |
size() |
open Any! | |
open Int |
Returns the index for the first occurrence of item in the adapter, or -1 if not found. |
open Boolean |
Removes the first occurrence of the given item from the adapter. |
open MutableList<E>! |
Gets a read-only view of the list of object of this ArrayObjectAdapter. |
open Boolean | |
open Int |
removeItems(position: Int, count: Int) Removes a range of items from the adapter. |
open Unit |
notifyArrayItemRangeChanged(positionStart: Int, itemCount: Int) Notify that the content of a range of items changed. |
open Unit |
Moved the item at fromPosition to toPosition. |
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
addAll
open fun addAll(index: Int, items: MutableCollection<Any?>!): Unit
Adds the objects in the given collection to the adapter, starting at the given index. If the index is >= #size
an exception will be thrown.
Parameters | |
---|---|
index |
Int: The index at which the items should be inserted. |
items |
Int: A Collection of items to insert. |
setItems
open fun setItems(itemList: MutableList<Any?>!, callback: DiffCallback<Any!>!): Unit
Set a new item list to adapter. The DiffUtil will compute the difference and dispatch it to specified position.
Parameters | |
---|---|
itemList |
MutableList<Any?>!: List of new Items |
callback |
MutableList<Any?>!: Optional DiffCallback Object to compute the difference between the old data set and new data set. When null, #notifyChanged() will be fired. |
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. |
add
open fun add(index: Int, item: Any!): Unit
Inserts an item into this adapter at the specified index. If the index is > #size
an exception will be thrown.
Parameters | |
---|---|
index |
Int: The index at which the item should be inserted. |
item |
Int: The item to insert into the adapter. |
replace
open fun replace(position: Int, item: Any!): Unit
Replaces item at position with a new item and calls notifyItemRangeChanged() at the given position. Note that this method does not compare new item to existing item.
Parameters | |
---|---|
position |
Int: The index of item to replace. |
item |
Int: The new item to be placed at given position. |
size
open fun size(): Int
indexOf
open fun indexOf(item: Any!): Int
Returns the index for the first occurrence of item in the adapter, or -1 if not found.
Parameters | |
---|---|
item |
Any!: The item to find in the list. |
Return | |
---|---|
Int: Index of the first occurrence of the item in the adapter, or -1 if not found. |
remove
open fun remove(item: Any!): Boolean
Removes the first occurrence of the given item from the adapter.
Parameters | |
---|---|
item |
Any!: The item to remove from the adapter. |
Return | |
---|---|
Boolean: True if the item was found and thus removed from the adapter. |
unmodifiableList
open fun <E : Any!> unmodifiableList(): MutableList<E>!
Gets a read-only view of the list of object of this ArrayObjectAdapter.
isImmediateNotifySupported
open fun isImmediateNotifySupported(): Boolean
removeItems
open fun removeItems(position: Int, count: Int): Int
Removes a range of items from the adapter. The range is specified by giving the starting position and the number of elements to remove.
Parameters | |
---|---|
position |
Int: The index of the first item to remove. |
count |
Int: The number of items to remove. |
Return | |
---|---|
Int: The number of items removed. |
notifyArrayItemRangeChanged
open fun notifyArrayItemRangeChanged(positionStart: Int, itemCount: Int): Unit
Notify that the content of a range of items changed. Note that this is not same as items being added or removed.
Parameters | |
---|---|
positionStart |
Int: The position of first item that has changed. |
itemCount |
Int: The count of how many items have changed. |
move
open fun move(fromPosition: Int, toPosition: Int): Unit
Moved the item at fromPosition to toPosition.
Parameters | |
---|---|
fromPosition |
Int: Previous position of the item. |
toPosition |
Int: New position of the item. |
Interfaces
- OnChildSelectedListener
- FocusHighlight
- ViewHolderTask
- OnItemViewClickedListener
- BrowseFrameLayout.OnChildFocusListener
- BrowseFrameLayout.OnFocusSearchListener
- BaseOnItemViewClickedListener
- BaseOnItemViewSelectedListener
- MultiActionsProvider
- FacetProviderAdapter
- GuidedActionAutofillSupport
- GuidedActionAutofillSupport.OnAutofillListener
- SearchBar.SearchBarListener
- SearchBar.SearchBarPermissionListener
- OnActionClickedListener
- PlaybackSeekUi
- TitleViewAdapter.Provider
- OnChildLaidOutListener
- FragmentAnimationProvider
- ImeKeyMonitor
- ImeKeyMonitor.ImeKeyListener
- SpeechRecognitionCallback
- BaseGridView.OnKeyInterceptListener
- BaseGridView.OnMotionInterceptListener
- BaseGridView.OnTouchInterceptListener
- BaseGridView.OnUnhandledKeyListener
- FacetProvider
- SearchEditText.OnKeyboardDismissListener
- OnItemViewSelectedListener
Classes
- SearchOrbView
- SearchOrbView.Colors
- ParallaxEffect
- SinglePresenterSelector
- Row
- RecyclerViewParallax
- RecyclerViewParallax.ChildPositionProperty
- PageRow
- PresenterSelector
- ObjectAdapter
- ObjectAdapter.DataObserver
- SectionRow
- DetailsOverviewLogoPresenter
- DetailsOverviewLogoPresenter.ViewHolder
- DetailsOverviewRowPresenter
- DetailsOverviewRowPresenter.ViewHolder
- GuidedAction
- GuidedAction.Builder
- GuidedAction.BuilderBase
- TitleView
- PresenterSwitcher
- ShadowOverlayHelper
- ShadowOverlayHelper.Builder
- ShadowOverlayHelper.Options
- BrowseFrameLayout
- AbstractDetailsDescriptionPresenter
- AbstractDetailsDescriptionPresenter.ViewHolder
- SpeechOrbView
- SparseArrayObjectAdapter
- AbstractMediaItemPresenter
- AbstractMediaItemPresenter.ViewHolder
- ParallaxTarget
- ParallaxTarget.DirectPropertyTarget
- ParallaxTarget.PropertyValuesHolderTarget
- GuidedDatePickerAction
- GuidedDatePickerAction.Builder
- GuidedDatePickerAction.BuilderBase
- VerticalGridView
- AbstractMediaListHeaderPresenter
- AbstractMediaListHeaderPresenter.ViewHolder
- DiffCallback
- MultiActionsProvider.MultiAction
- FullWidthDetailsOverviewRowPresenter
- FullWidthDetailsOverviewRowPresenter.Listener
- FullWidthDetailsOverviewRowPresenter.ViewHolder
- FullWidthDetailsOverviewRowPresenter.ViewHolder.DetailsOverviewRowListener
- HeaderItem
- ItemAlignmentFacet
- ItemAlignmentFacet.ItemAlignmentDef
- ControlButtonPresenterSelector
- VerticalGridPresenter
- VerticalGridPresenter.ViewHolder
- DetailsOverviewRow
- DetailsOverviewRow.Listener
- PlaybackTransportRowPresenter
- PlaybackTransportRowPresenter.ViewHolder
- SearchBar
- ListRowView
- PlaybackSeekUi.Client
- TitleViewAdapter
- GuidanceStylist
- GuidanceStylist.Guidance
- ListRow
- ClassPresenterSelector
- DetailsParallax
- PlaybackRowPresenter
- PlaybackRowPresenter.ViewHolder
- ItemBridgeAdapter
- ItemBridgeAdapter.AdapterListener
- ItemBridgeAdapter.ViewHolder
- ItemBridgeAdapter.Wrapper
- RowHeaderView
- HorizontalGridView
- DividerPresenter
- ListRowHoverCardView
- PlaybackSeekDataProvider
- PlaybackSeekDataProvider.ResultCallback
- TitleHelper
- RowPresenter
- RowPresenter.ViewHolder
- OnChildViewHolderSelectedListener
- ImageCardView
- CursorObjectAdapter
- GuidedActionDiffCallback
- BaseCardView
- BaseCardView.LayoutParams
- Parallax
- Parallax.FloatProperty
- Parallax.IntProperty
- Parallax.PropertyMarkerValue
- ShadowOverlayContainer
- RowHeaderPresenter
- RowHeaderPresenter.ViewHolder
- ItemBridgeAdapterShadowOverlayWrapper
- PlaybackControlsRow
- PlaybackControlsRow.ClosedCaptioningAction
- PlaybackControlsRow.FastForwardAction
- PlaybackControlsRow.HighQualityAction
- PlaybackControlsRow.MoreActions
- PlaybackControlsRow.MultiAction
- PlaybackControlsRow.OnPlaybackProgressCallback
- PlaybackControlsRow.PictureInPictureAction
- PlaybackControlsRow.PlayPauseAction
- PlaybackControlsRow.RepeatAction
- PlaybackControlsRow.RewindAction
- PlaybackControlsRow.ShuffleAction
- PlaybackControlsRow.SkipNextAction
- PlaybackControlsRow.SkipPreviousAction
- PlaybackControlsRow.ThumbsAction
- PlaybackControlsRow.ThumbsDownAction
- PlaybackControlsRow.ThumbsUpAction
- PlaybackControlsRowPresenter
- PlaybackControlsRowPresenter.ViewHolder
- FullWidthDetailsOverviewSharedElementHelper
- HorizontalHoverCardSwitcher
- Action
- ArrayObjectAdapter
- BaseGridView
- DividerRow
- SearchEditText
- FocusHighlightHelper
- Presenter
- Presenter.ViewHolder
- Presenter.ViewHolderTask
- GuidedActionsStylist
- GuidedActionsStylist.ViewHolder
- ListRowPresenter
- ListRowPresenter.SelectItemViewHolderTask
- ListRowPresenter.ViewHolder
- GuidedActionEditText