belongs to Maven artifact com.android.support:leanback-v17:28.0.0-alpha1
CursorObjectAdapter
public
class
CursorObjectAdapter
extends ObjectAdapter
java.lang.Object | ||
↳ | android.support.v17.leanback.widget.ObjectAdapter | |
↳ | android.support.v17.leanback.widget.CursorObjectAdapter |
An ObjectAdapter
implemented with a Cursor
.
Summary
Inherited constants |
---|
From
class
android.support.v17.leanback.widget.ObjectAdapter
|
Public constructors | |
---|---|
CursorObjectAdapter(PresenterSelector presenterSelector)
Constructs an adapter with the given |
|
CursorObjectAdapter(Presenter presenter)
Constructs an adapter that uses the given |
|
CursorObjectAdapter()
Constructs an adapter. |
Public methods | |
---|---|
void
|
changeCursor(Cursor cursor)
Changes the underlying cursor to a new cursor. |
void
|
close()
Closes this adapter, closing the backing |
Object
|
get(int index)
Returns the item for the given position. |
final
Cursor
|
getCursor()
Returns the |
final
CursorMapper
|
getMapper()
Returns the |
boolean
|
isClosed()
Returns true if the adapter, and hence the backing |
boolean
|
isImmediateNotifySupported()
Returns true if the adapter pairs each underlying data change with a call to notify and false otherwise. |
final
void
|
setMapper(CursorMapper mapper)
Sets the |
int
|
size()
Returns the number of items in the adapter. |
Cursor
|
swapCursor(Cursor cursor)
Swap in a new Cursor, returning the old Cursor. |
Protected methods | |
---|---|
final
void
|
invalidateCache(int index)
Removes an item from the cache. |
final
void
|
invalidateCache(int index, int count)
Removes |
void
|
onCursorChanged()
Called whenever the cursor changes. |
void
|
onMapperChanged()
Called when |
Inherited methods | |
---|---|
From
class
android.support.v17.leanback.widget.ObjectAdapter
| |
From
class
java.lang.Object
|
Public constructors
CursorObjectAdapter
CursorObjectAdapter (PresenterSelector presenterSelector)
Constructs an adapter with the given PresenterSelector
.
Parameters | |
---|---|
presenterSelector |
PresenterSelector |
CursorObjectAdapter
CursorObjectAdapter (Presenter presenter)
Constructs an adapter that uses the given Presenter
for all items.
Parameters | |
---|---|
presenter |
Presenter |
Public methods
changeCursor
void changeCursor (Cursor cursor)
Changes the underlying cursor to a new cursor. If there is an existing cursor it will be closed if it is different than the new cursor.
Parameters | |
---|---|
cursor |
Cursor : The new cursor to be used.
|
close
void close ()
Closes this adapter, closing the backing Cursor
as well.
get
Object get (int index)
Returns the item for the given position.
Parameters | |
---|---|
index |
int |
Returns | |
---|---|
Object |
getCursor
Cursor getCursor ()
Returns the Cursor
backing the adapter.
Returns | |
---|---|
Cursor |
getMapper
CursorMapper getMapper ()
Returns the CursorMapper
used to convert Cursor
rows into
Objects.
Returns | |
---|---|
CursorMapper |
isClosed
boolean isClosed ()
Returns true if the adapter, and hence the backing Cursor
, is closed; false
otherwise.
Returns | |
---|---|
boolean |
isImmediateNotifySupported
boolean isImmediateNotifySupported ()
Returns true if the adapter pairs each underlying data change with a call to notify and false otherwise.
Returns | |
---|---|
boolean |
setMapper
void setMapper (CursorMapper mapper)
Sets the CursorMapper
used to convert Cursor
rows into
Objects.
Parameters | |
---|---|
mapper |
CursorMapper |
swapCursor
Cursor swapCursor (Cursor cursor)
Swap in a new Cursor, returning the old Cursor. Unlike changeCursor(Cursor), the returned old Cursor is not closed.
Parameters | |
---|---|
cursor |
Cursor : The new cursor to be used.
|
Returns | |
---|---|
Cursor |
Protected methods
invalidateCache
void invalidateCache (int index)
Removes an item from the cache. This will force the item to be re-read
from the data source the next time get(int)
is called.
Parameters | |
---|---|
index |
int |
invalidateCache
void invalidateCache (int index, int count)
Removes count
items starting at index
.
Parameters | |
---|---|
index |
int |
count |
int |
onMapperChanged
void onMapperChanged ()
Called when setMapper(CursorMapper)
is called and a different
mapper is provided.
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