belongs to Maven artifact com.android.support:leanback-v17:28.0.0-alpha1
ArrayObjectAdapter
public
class
ArrayObjectAdapter
extends ObjectAdapter
java.lang.Object | ||
↳ | android.support.v17.leanback.widget.ObjectAdapter | |
↳ | android.support.v17.leanback.widget.ArrayObjectAdapter |
An ObjectAdapter
implemented with an ArrayList
.
Summary
Inherited constants |
---|
From
class
android.support.v17.leanback.widget.ObjectAdapter
|
Public constructors | |
---|---|
ArrayObjectAdapter(PresenterSelector presenterSelector)
Constructs an adapter with the given |
|
ArrayObjectAdapter(Presenter presenter)
Constructs an adapter that uses the given |
|
ArrayObjectAdapter()
Constructs an adapter. |
Public methods | |
---|---|
void
|
add(Object item)
Adds an item to the end of the adapter. |
void
|
add(int index, Object item)
Inserts an item into this adapter at the specified index. |
void
|
addAll(int index, Collection items)
Adds the objects in the given collection to the adapter, starting at the given index. |
void
|
clear()
Removes all items from this adapter, leaving it empty. |
Object
|
get(int index)
Returns the item for the given position. |
int
|
indexOf(Object item)
Returns the index for the first occurrence of item in the adapter, or -1 if not found. |
boolean
|
isImmediateNotifySupported()
Returns true if the adapter pairs each underlying data change with a call to notify and false otherwise. |
void
|
move(int fromPosition, int toPosition)
Moved the item at fromPosition to toPosition. |
void
|
notifyArrayItemRangeChanged(int positionStart, int itemCount)
Notify that the content of a range of items changed. |
boolean
|
remove(Object item)
Removes the first occurrence of the given item from the adapter. |
int
|
removeItems(int position, int count)
Removes a range of items from the adapter. |
void
|
replace(int position, Object item)
Replaces item at position with a new item and calls notifyItemRangeChanged() at the given position. |
void
|
setItems(List itemList, DiffCallback callback)
Set a new item list to adapter. |
int
|
size()
Returns the number of items in the adapter. |
<E>
List<E>
|
unmodifiableList()
Gets a read-only view of the list of object of this ArrayObjectAdapter. |
Inherited methods | |
---|---|
From
class
android.support.v17.leanback.widget.ObjectAdapter
| |
From
class
java.lang.Object
|
Public constructors
ArrayObjectAdapter
ArrayObjectAdapter (PresenterSelector presenterSelector)
Constructs an adapter with the given PresenterSelector
.
Parameters | |
---|---|
presenterSelector |
PresenterSelector |
ArrayObjectAdapter
ArrayObjectAdapter (Presenter presenter)
Constructs an adapter that uses the given Presenter
for all items.
Parameters | |
---|---|
presenter |
Presenter |
Public methods
add
void add (Object item)
Adds an item to the end of the adapter.
Parameters | |
---|---|
item |
Object : The item to add to the end of the adapter.
|
add
void add (int index, Object item)
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 |
Object : The item to insert into the adapter.
|
addAll
void addAll (int index, Collection items)
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 |
Collection : A Collection of items to insert.
|
get
Object get (int index)
Returns the item for the given position.
Parameters | |
---|---|
index |
int |
Returns | |
---|---|
Object |
indexOf
int indexOf (Object item)
Returns the index for the first occurrence of item in the adapter, or -1 if not found.
Parameters | |
---|---|
item |
Object : The item to find in the list. |
Returns | |
---|---|
int |
Index of the first occurrence of the item in the adapter, or -1 if not found. |
isImmediateNotifySupported
boolean isImmediateNotifySupported ()
Returns true if the adapter pairs each underlying data change with a call to notify and false otherwise.
Returns | |
---|---|
boolean |
move
void move (int fromPosition, int toPosition)
Moved the item at fromPosition to toPosition.
Parameters | |
---|---|
fromPosition |
int : Previous position of the item. |
toPosition |
int : New position of the item.
|
notifyArrayItemRangeChanged
void notifyArrayItemRangeChanged (int positionStart, int itemCount)
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.
|
remove
boolean remove (Object item)
Removes the first occurrence of the given item from the adapter.
Parameters | |
---|---|
item |
Object : The item to remove from the adapter. |
Returns | |
---|---|
boolean |
True if the item was found and thus removed from the adapter. |
removeItems
int removeItems (int position, int count)
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. |
Returns | |
---|---|
int |
The number of items removed. |
replace
void replace (int position, Object item)
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 |
Object : The new item to be placed at given position.
|
setItems
void setItems (List itemList, DiffCallback callback)
Set a new item list to adapter. The DiffUtil will compute the difference and dispatch it to specified position.
Parameters | |
---|---|
itemList |
List : List of new Items |
callback |
DiffCallback : Optional DiffCallback Object to compute the difference between the old data
set and new data set. When null, notifyChanged() will be fired.
|
unmodifiableList
List<E> unmodifiableList ()
Gets a read-only view of the list of object of this ArrayObjectAdapter.
Returns | |
---|---|
List<E> |
Interfaces
- BaseGridView.OnKeyInterceptListener
- BaseGridView.OnMotionInterceptListener
- BaseGridView.OnTouchInterceptListener
- BaseGridView.OnUnhandledKeyListener
- BaseOnItemViewClickedListener
- BaseOnItemViewSelectedListener
- BrowseFrameLayout.OnChildFocusListener
- BrowseFrameLayout.OnFocusSearchListener
- FacetProvider
- FacetProviderAdapter
- FocusHighlight
- FragmentAnimationProvider
- ImeKeyMonitor
- ImeKeyMonitor.ImeKeyListener
- MultiActionsProvider
- OnActionClickedListener
- OnChildLaidOutListener
- OnChildSelectedListener
- OnItemViewClickedListener
- OnItemViewSelectedListener
- PlaybackSeekUi
- SearchBar.SearchBarListener
- SearchBar.SearchBarPermissionListener
- SearchEditText.OnKeyboardDismissListener
- SpeechRecognitionCallback
- TitleViewAdapter.Provider
- ViewHolderTask
Classes
- AbstractDetailsDescriptionPresenter
- AbstractDetailsDescriptionPresenter.ViewHolder
- AbstractMediaItemPresenter
- AbstractMediaItemPresenter.ViewHolder
- AbstractMediaListHeaderPresenter
- AbstractMediaListHeaderPresenter.ViewHolder
- Action
- ArrayObjectAdapter
- BaseCardView
- BaseCardView.LayoutParams
- BaseGridView
- BrowseFrameLayout
- ClassPresenterSelector
- ControlButtonPresenterSelector
- CursorObjectAdapter
- DetailsOverviewLogoPresenter
- DetailsOverviewLogoPresenter.ViewHolder
- DetailsOverviewRow
- DetailsOverviewRow.Listener
- DetailsOverviewRowPresenter
- DetailsOverviewRowPresenter.ViewHolder
- DetailsParallax
- DiffCallback
- DividerPresenter
- DividerRow
- FocusHighlightHelper
- FullWidthDetailsOverviewRowPresenter
- FullWidthDetailsOverviewRowPresenter.Listener
- FullWidthDetailsOverviewRowPresenter.ViewHolder
- FullWidthDetailsOverviewRowPresenter.ViewHolder.DetailsOverviewRowListener
- FullWidthDetailsOverviewSharedElementHelper
- GuidanceStylist
- GuidanceStylist.Guidance
- GuidedAction
- GuidedAction.Builder
- GuidedAction.BuilderBase
- GuidedActionDiffCallback
- GuidedActionEditText
- GuidedActionsStylist
- GuidedActionsStylist.ViewHolder
- GuidedDatePickerAction
- GuidedDatePickerAction.Builder
- GuidedDatePickerAction.BuilderBase
- HeaderItem
- HorizontalGridView
- HorizontalHoverCardSwitcher
- ImageCardView
- ItemAlignmentFacet
- ItemAlignmentFacet.ItemAlignmentDef
- ItemBridgeAdapter
- ItemBridgeAdapter.AdapterListener
- ItemBridgeAdapter.ViewHolder
- ItemBridgeAdapter.Wrapper
- ItemBridgeAdapterShadowOverlayWrapper
- ListRow
- ListRowHoverCardView
- ListRowPresenter
- ListRowPresenter.SelectItemViewHolderTask
- ListRowPresenter.ViewHolder
- ListRowView
- MultiActionsProvider.MultiAction
- ObjectAdapter
- ObjectAdapter.DataObserver
- OnChildViewHolderSelectedListener
- PageRow
- Parallax
- Parallax.FloatProperty
- Parallax.IntProperty
- Parallax.PropertyMarkerValue
- ParallaxEffect
- ParallaxTarget
- ParallaxTarget.DirectPropertyTarget
- ParallaxTarget.PropertyValuesHolderTarget
- 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
- PlaybackRowPresenter
- PlaybackRowPresenter.ViewHolder
- PlaybackSeekDataProvider
- PlaybackSeekDataProvider.ResultCallback
- PlaybackSeekUi.Client
- PlaybackTransportRowPresenter
- PlaybackTransportRowPresenter.ViewHolder
- Presenter
- Presenter.ViewHolder
- Presenter.ViewHolderTask
- PresenterSelector
- PresenterSwitcher
- RecyclerViewParallax
- RecyclerViewParallax.ChildPositionProperty
- Row
- RowHeaderPresenter
- RowHeaderPresenter.ViewHolder
- RowHeaderView
- RowPresenter
- RowPresenter.ViewHolder
- SearchBar
- SearchEditText
- SearchOrbView
- SearchOrbView.Colors
- SectionRow
- ShadowOverlayContainer
- ShadowOverlayHelper
- ShadowOverlayHelper.Builder
- ShadowOverlayHelper.Options
- SinglePresenterSelector
- SparseArrayObjectAdapter
- SpeechOrbView
- TitleHelper
- TitleView
- TitleViewAdapter
- VerticalGridPresenter
- VerticalGridPresenter.ViewHolder
- VerticalGridView