Known direct subclasses
AbstractMediaItemPresenter, AbstractMediaListHeaderPresenter, DetailsOverviewRowPresenter, FullWidthDetailsOverviewRowPresenter, ListRowPresenter, PlaybackRowPresenter
Known indirect subclasses
Customize UI widgetsWhen a subclass of RowPresenter adds UI widgets, it should subclass
initializeRowViewHolder(ViewHolder). The subclass must use layout id "row_content" for the widget that will be aligned to the title of any
HeadersFragmentthat may exist in the parent fragment. RowPresenter contains an optional and replaceable
RowHeaderPresenterthat renders the header. You can disable the default rendering or replace the Presenter with a new header presenter by calling
UI events from fragmentsRowPresenter 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 override
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 override
Activated statusThe activated status of a row is applied to the row view and its children via
View.setActivated(boolean). The activated status is typically used to control
BaseCardViewinfo 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_EXPANDEDActivated status is synced with row expanded status
SYNC_ACTIVATED_TO_SELECTEDActivated status is synced with row selected status
SYNC_ACTIVATED_TO_EXPANDED_AND_SELECTEDActivated status is set to true when both expanded and selected status are true
SYNC_ACTIVATED_CUSTOMActivated status is not controlled by selected status or expanded status, application can control activated status by its own. Application should call
RowPresenter.ViewHolder.setActivated(boolean)to change activated status of row view.
User eventsRowPresenter provides
OnItemViewClickedListener. If a subclass wants to add its own
View.OnClickListener, it must do that in
createRowViewHolder(ViewGroup)to be properly chained by the library. Adding View listeners after
createRowViewHolder(ViewGroup)is undefined and may result in incorrect behavior by the library's listeners.
When a user scrolls through rows, a fragment will initiate animation and call
setSelectLevel(Presenter.ViewHolder, float) with float value between
0 and 1. By default, the RowPresenter draws a dim overlay on top of the row
view for views that are not selected. Subclasses may override this default effect
isUsingDefaultSelectEffect() return false and overriding
onSelectLevelChanged(ViewHolder) to apply a different selection effect.
setSelectEffectEnabled(boolean) to enable/disable the select effect,
This will not only enable/disable the default dim effect but also subclasses must
respect this flag as well.
A ViewHolder for a
Don't synchronize row view activated status with selected status or expanded status,
application will do its own through
Synchronizes row view's activated status to expand status of the row view holder.
Sets the row view's activated status to true when both expand and selected are true.
Synchronizes row view's activated status to selected status of the row view holder.
Constructs a RowPresenter.