java.lang.Object | |||
↳ | android.support.v17.leanback.widget.Presenter | ||
↳ | android.support.v17.leanback.widget.RowPresenter | ||
↳ | android.support.v17.leanback.widget.FullWidthDetailsOverviewRowPresenter |
Renders a DetailsOverviewRow
to display an overview of an item. Typically this row will
be the first row in a fragment such as the
DetailsFragment
. The View created by the
FullWidthDetailsOverviewRowPresenter is made in three parts: logo view on the left, action list view on
the top and a customizable detailed description view on the right.
The detailed description is rendered using a Presenter
passed in
FullWidthDetailsOverviewRowPresenter(Presenter)
. Typically this will be an instance of
AbstractDetailsDescriptionPresenter
. The application can access the detailed description
ViewHolder from getDetailsDescriptionViewHolder()
.
The logo view is rendered using a customizable DetailsOverviewLogoPresenter
passed in
FullWidthDetailsOverviewRowPresenter(Presenter, DetailsOverviewLogoPresenter)
. The application
can access the logo ViewHolder from getLogoViewHolder()
.
To support activity shared element transition, call setListener(Listener)
with
FullWidthDetailsOverviewSharedElementHelper
during Activity's onCreate(). Application is free to
create its own "shared element helper" class using the Listener for image binding.
Call setParticipatingEntranceTransition(boolean)
with false
The view has three states: STATE_HALF
STATE_FULL
and STATE_SMALL
. See
DetailsFragment
where it switches states based on
selected row position.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
FullWidthDetailsOverviewRowPresenter.Listener | Listeners for events on ViewHolder. | ||||||||||
FullWidthDetailsOverviewRowPresenter.ViewHolder | A ViewHolder for the DetailsOverviewRow. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | ALIGN_MODE_MIDDLE | This is the alignment mode that the ending edge of logo and the starting edge of description align to the middle of the overview view. | |||||||||
int | ALIGN_MODE_START | This is the alignment mode that the logo and description align to the starting edge of the overview view. | |||||||||
int | STATE_FULL | This is the state when the view covers full width and height of screen. | |||||||||
int | STATE_HALF | This is the default state corresponding to layout file. | |||||||||
int | STATE_SMALL | This is the state where the view shrinks to a small banner. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
android.support.v17.leanback.widget.RowPresenter
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
mInitialState |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructor for a FullWidthDetailsOverviewRowPresenter.
| |||||||||||
Constructor for a FullWidthDetailsOverviewRowPresenter.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the background color of actions.
| |||||||||||
Returns alignment mode of Description.
| |||||||||||
Returns the background color.
| |||||||||||
Returns the initial state used to create ViewHolder.
| |||||||||||
Returns the listener for Action click events.
| |||||||||||
Returns true if the overview should be part of shared element transition.
| |||||||||||
Returns true if this RowPresenter is using the default dimming effect.
| |||||||||||
Called by
DetailsOverviewLogoPresenter to notify logo was bound to view.
| |||||||||||
Sets the background color for Action Bar.
| |||||||||||
Set alignment mode of Description.
| |||||||||||
Sets the background color.
| |||||||||||
Changes the visibility of views.
| |||||||||||
Change the initial state used to create ViewHolder.
| |||||||||||
Set listener for details overview presenter.
| |||||||||||
Sets the listener for Action click events.
| |||||||||||
Sets if the overview should be part of shared element transition.
| |||||||||||
Switch state of a ViewHolder.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Called to create a ViewHolder object for a Row.
| |||||||||||
Get resource id to inflate the layout.
| |||||||||||
Returns true if the Row view should clip it's children.
| |||||||||||
Binds the given row object to the given ViewHolder.
| |||||||||||
Layout logo position based on current state.
| |||||||||||
Layout overview frame based on current state.
| |||||||||||
Invoked when the row view is attached to the window.
| |||||||||||
Invoked when the row view is detached from the window.
| |||||||||||
Callback when the select level changes.
| |||||||||||
Called when
getState() changes.
| |||||||||||
Unbinds the given ViewHolder.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
android.support.v17.leanback.widget.RowPresenter
| |||||||||||
From class
android.support.v17.leanback.widget.Presenter
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
android.support.v17.leanback.widget.FacetProvider
|
This is the alignment mode that the ending edge of logo and the starting edge of description align to the middle of the overview view. Note that this might not be the exact horizontal center of the overview view.
This is the alignment mode that the logo and description align to the starting edge of the overview view.
This is the state when the view covers full width and height of screen.
This is the default state corresponding to layout file. The view takes full width of screen and covers bottom half of the screen.
This is the state where the view shrinks to a small banner.
Constructor for a FullWidthDetailsOverviewRowPresenter.
detailsPresenter | The Presenter used to render the detailed
description of the row.
|
---|
Returns the background color of actions. If setActionsBackgroundColor(int)
is not called, transparent is returned.
Returns alignment mode of Description.
ALIGN_MODE_MIDDLE
or ALIGN_MODE_START
.
Returns the background color. If setBackgroundColor(int)
, transparent
is returned.
Returns the initial state used to create ViewHolder.
Returns the listener for Action click events.
Returns true if the overview should be part of shared element transition.
Returns true if this RowPresenter is using the default dimming effect.
A subclass may (most likely) return false and
override onSelectLevelChanged(ViewHolder)
.
Called by DetailsOverviewLogoPresenter
to notify logo was bound to view.
Application should not directly call this method.
viewHolder | The row ViewHolder that has logo bound to view. |
---|
Sets the background color for Action Bar. If not set, a default from the theme will be used.
Set alignment mode of Description.
alignmentMode | One of ALIGN_MODE_MIDDLE or ALIGN_MODE_START
|
---|
Sets the background color. If not set, a default from the theme will be used.
Changes the visibility of views. The entrance transition will be run against the views that change visibilities. A subclass may override and begin with calling super.setEntranceTransitionState(). This method is called by the fragment, it should not call it directly by the application.
Change the initial state used to create ViewHolder.
Set listener for details overview presenter. Must be called before creating ViewHolder.
Sets the listener for Action click events.
Sets if the overview should be part of shared element transition.
Switch state of a ViewHolder.
viewHolder | The ViewHolder to change state. |
---|---|
state | New state, can be STATE_FULL , STATE_HALF
or STATE_SMALL .
|
Called to create a ViewHolder object for a Row. Subclasses will override this method to return a different concrete ViewHolder object.
parent | The parent View for the Row's view holder. |
---|
Get resource id to inflate the layout. The layout must match STATE_HALF
Returns true if the Row view should clip it's children. The clipChildren
flag is set on view in initializeRowViewHolder(ViewHolder)
. Note that
Slide transition or explode transition need turn off clipChildren.
Default value is false.
Binds the given row object to the given ViewHolder.
Layout logo position based on current state. Subclass may override. The method is called when a logo is bound to view or state changes.
viewHolder | The row ViewHolder that contains the logo. |
---|---|
oldState | The old state, can be same as current viewHolder.getState() |
logoChanged | Whether logo was changed. |
Layout overview frame based on current state. Subclass may override. The method is called when a logo is bound to view or state changes.
viewHolder | The row ViewHolder that contains the logo. |
---|---|
oldState | The old state, can be same as current viewHolder.getState() |
logoChanged | Whether logo was changed. |
Invoked when the row view is attached to the window.
Invoked when the row view is detached from the window.
Callback when the select level changes. The default implementation applies
the select level to setSelectLevel(RowHeaderPresenter.ViewHolder, float)
when getSelectEffectEnabled()
is true. Subclasses may override
this function and implement a different select effect. In this case,
the method isUsingDefaultSelectEffect()
should also be overridden to disable
the default dimming effect.
Called when getState()
changes. Subclass may override.
The default implementation calls onLayoutLogo(ViewHolder, int, boolean)
and
onLayoutOverviewFrame(ViewHolder, int, boolean)
.
viewHolder | The ViewHolder which state changed. |
---|---|
oldState | The old state. |