belongs to Maven artifact com.android.support:leanback-v17:28.0.0-alpha1
SparseArrayObjectAdapter
public
class
SparseArrayObjectAdapter
extends ObjectAdapter
java.lang.Object | ||
↳ | android.support.v17.leanback.widget.ObjectAdapter | |
↳ | android.support.v17.leanback.widget.SparseArrayObjectAdapter |
An ObjectAdapter
implemented with a 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 |
---|
From
class
android.support.v17.leanback.widget.ObjectAdapter
|
Public constructors | |
---|---|
SparseArrayObjectAdapter(PresenterSelector presenterSelector)
Constructs an adapter with the given |
|
SparseArrayObjectAdapter(Presenter presenter)
Constructs an adapter with the given |
|
SparseArrayObjectAdapter()
Constructs an adapter. |
Public methods | |
---|---|
void
|
clear(int key)
Clears the given key and associated item from the adapter. |
void
|
clear()
Removes all items from this adapter, leaving it empty. |
Object
|
get(int position)
Returns the item for the given position. |
int
|
indexOf(Object item)
Returns the index for the given item in the adapter. |
int
|
indexOf(int key)
Returns the index for the given key in the adapter. |
boolean
|
isImmediateNotifySupported()
Returns true if the adapter pairs each underlying data change with a call to notify and false otherwise. |
Object
|
lookup(int key)
Returns the object for the given key, or null if no mapping for that key exists. |
void
|
notifyArrayItemRangeChanged(int positionStart, int itemCount)
Notify that the content of a range of items changed. |
void
|
set(int key, Object item)
Sets the item for the given key. |
int
|
size()
Returns the number of items in the adapter. |
Inherited methods | |
---|---|
From
class
android.support.v17.leanback.widget.ObjectAdapter
| |
From
class
java.lang.Object
|
Public constructors
SparseArrayObjectAdapter
SparseArrayObjectAdapter (PresenterSelector presenterSelector)
Constructs an adapter with the given PresenterSelector
.
Parameters | |
---|---|
presenterSelector |
PresenterSelector |
SparseArrayObjectAdapter
SparseArrayObjectAdapter (Presenter presenter)
Constructs an adapter with the given Presenter
.
Parameters | |
---|---|
presenter |
Presenter |
Public methods
clear
void clear (int key)
Clears the given key and associated item from the adapter.
Parameters | |
---|---|
key |
int : The key to be cleared.
|
get
Object get (int position)
Returns the item for the given position.
Parameters | |
---|---|
position |
int |
Returns | |
---|---|
Object |
indexOf
int indexOf (Object item)
Returns the index for the given item in the adapter.
Parameters | |
---|---|
item |
Object : The item to find in the array. |
Returns | |
---|---|
int |
Index of the item, or a negative value if not found. |
indexOf
int indexOf (int key)
Returns the index for the given key in the adapter.
Parameters | |
---|---|
key |
int : The key to find in the array. |
Returns | |
---|---|
int |
Index of the item, or a negative value 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 |
lookup
Object lookup (int key)
Returns the object for the given key, or null if no mapping for that key exists.
Parameters | |
---|---|
key |
int |
Returns | |
---|---|
Object |
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.
|
set
void set (int key, Object item)
Sets the item for the given key.
Parameters | |
---|---|
key |
int : The key associated with the item. |
item |
Object : The item associated with the key.
|
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