added in version 22.1.0
belongs to Maven artifact com.android.support:leanback-v17:28.0.0-alpha1
belongs to Maven artifact com.android.support:leanback-v17:28.0.0-alpha1
Summary:
Nested Classes
| Constants
| Ctors
| Methods
| Protected Methods
| Inherited Methods
| [Expand All]
RowPresenter
public
abstract
class
RowPresenter
extends Presenter
java.lang.Object | ||
↳ | android.support.v17.leanback.widget.Presenter | |
↳ | android.support.v17.leanback.widget.RowPresenter |
![]() |
![]() |
An abstract Presenter
that renders an Object in RowsFragment, the object can be
subclass Row
or a generic one. When the object is not Row
class,
getRow()
returns null.
Customize UI widgets
When a subclass of RowPresenter adds UI widgets, it should subclassRowPresenter.ViewHolder
and override createRowViewHolder(ViewGroup)
and initializeRowViewHolder(ViewHolder)
. The subclass must use layout id
"row_content" for the widget that will be aligned to the title of any HeadersFragment
that may exist in the parent fragment. RowPresenter contains an optional and
replaceable RowHeaderPresenter
that renders the header. You can disable
the default rendering or replace the Presenter with a new header presenter
by calling setHeaderPresenter(RowHeaderPresenter)
.
UI events from fragments
RowPresenter receives calls from its parent (typically a Fragment) when:-
A row is selected via
setRowViewSelected(Presenter.ViewHolder, boolean)
. The event is triggered immediately when there is a row selection change before the selection animation is started. Selected status may control activated status of the row (see "Activated status" below). Subclasses of RowPresenter may overrideonRowViewSelected(ViewHolder, boolean)
. -
A row is expanded to full height via
setRowViewExpanded(Presenter.ViewHolder, boolean)
when BrowseFragment hides fast lane on the left. The event is triggered immediately before the expand animation is started. Row title is shown when row is expanded. Expanded status may control activated status of the row (see "Activated status" below). Subclasses of RowPresenter may overrideonRowViewExpanded(ViewHolder, boolean)
.
Activated status
The activated status of a row is applied to the row view and its children viasetActivated(boolean)
.
The activated status is typically used to control BaseCardView
info region visibility.
The row's activated status can be controlled by selected status and/or expanded status.
Call setSyncActivatePolicy(int)
and choose one of the four policies:
SYNC_ACTIVATED_TO_EXPANDED
Activated status is synced with row expanded statusSYNC_ACTIVATED_TO_SELECTED
Activated status is synced with row selected statusSYNC_ACTIVATED_TO_EXPANDED_AND_SELECTED
Activated status is set to true when both expanded and selected status are trueSYNC_ACTIVATED_CUSTOM
Activated status is not controlled by selected status or expanded status, application can control activated status by its own. Application should callsetActivated(boolean)
to change activated status of row view.
User events
RowPresenter providesOnItemViewSelectedListener
and