public
class
DetailsOverviewRowPresenter
extends RowPresenter
java.lang.Object | |||
↳ | android.support.v17.leanback.widget.Presenter | ||
↳ | android.support.v17.leanback.widget.RowPresenter | ||
↳ | android.support.v17.leanback.widget.DetailsOverviewRowPresenter |
This class is deprecated.
Use 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 DetailsOverviewRowPresenter is made in three parts:
ImageView on the left, action list view on the bottom and a customizable detailed
description view on the right.
The detailed description is rendered using a Presenter
passed in
DetailsOverviewRowPresenter(Presenter)
. Typically this will be an instance of
AbstractDetailsDescriptionPresenter
. The application can access the
detailed description ViewHolder from mDetailsDescriptionViewHolder
.
To participate in activity transition, call setSharedElementEnterTransition(Activity, String)
during Activity's onCreate().
Because transition support and layout are fully controlled by DetailsOverviewRowPresenter, developer can not override DetailsOverviewRowPresenter.ViewHolder for adding/replacing views of DetailsOverviewRowPresenter. If further customization is required beyond replacing the detailed description, the application should create a new row presenter class.
Nested classes | |
---|---|
class |
DetailsOverviewRowPresenter.ViewHolder
A ViewHolder for the DetailsOverviewRow. |
Inherited constants |
---|
From
class
android.support.v17.leanback.widget.RowPresenter
|
Public constructors | |
---|---|
DetailsOverviewRowPresenter(Presenter detailsPresenter)
Constructor for a DetailsOverviewRowPresenter. |
Public methods | |
---|---|
int
|
getBackgroundColor()
Returns the background color. |
OnActionClickedListener
|
getOnActionClickedListener()
Returns the listener for Action click events. |
boolean
|
isStyleLarge()
Returns true if the layout style is large. |
final
boolean
|
isUsingDefaultSelectEffect()
Returns true if this RowPresenter is using the default dimming effect. |
void
|
setBackgroundColor(int color)
Sets the background color. |
void
|
setOnActionClickedListener(OnActionClickedListener listener)
Sets the listener for Action click events. |
final
void
|
setSharedElementEnterTransition(Activity activity, String sharedElementName, long timeoutMs)
Sets the enter transition of target activity to be transiting into overview row created by this presenter. |
final
void
|
setSharedElementEnterTransition(Activity activity, String sharedElementName)
Sets the enter transition of target activity to be transiting into overview row created by this presenter. |
void
|
setStyleLarge(boolean large)
Sets the layout style to be large or small. |
Protected methods | |
---|---|
RowPresenter.ViewHolder
|
createRowViewHolder(ViewGroup parent)
Called to create a ViewHolder object for a Row. |
void
|
onBindRowViewHolder(RowPresenter.ViewHolder holder, Object item)
Binds the given row object to the given ViewHolder. |
void
|
onRowViewAttachedToWindow(RowPresenter.ViewHolder vh)
Invoked when the row view is attached to the window. |
void
|
onRowViewDetachedFromWindow(RowPresenter.ViewHolder vh)
Invoked when the row view is detached from the window. |
void
|
onRowViewSelected(RowPresenter.ViewHolder vh, boolean selected)
Called when the given row view changes selection state. |
void
|
onSelectLevelChanged(RowPresenter.ViewHolder holder)
Callback when the select level changes. |
void
|
onUnbindRowViewHolder(RowPresenter.ViewHolder holder)
Unbinds the given ViewHolder. |
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
|
DetailsOverviewRowPresenter (Presenter detailsPresenter)
Constructor for a DetailsOverviewRowPresenter.
Parameters | |
---|---|
detailsPresenter |
Presenter :
The Presenter used to render the detailed
description of the row.
|
int getBackgroundColor ()
Returns the background color. If no background color was set, transparent is returned.
Returns | |
---|---|
int |
OnActionClickedListener getOnActionClickedListener ()
Returns the listener for Action click events.
Returns | |
---|---|
OnActionClickedListener |
boolean isStyleLarge ()
Returns true if the layout style is large.
Returns | |
---|---|
boolean |
boolean isUsingDefaultSelectEffect ()
Returns true if this RowPresenter is using the default dimming effect.
A subclass may (most likely) return false and
override onSelectLevelChanged(ViewHolder)
.
Returns | |
---|---|
boolean |
void setBackgroundColor (int color)
Sets the background color. If not set, a default from the theme will be used.
Parameters | |
---|---|
color |
int
|
void setOnActionClickedListener (OnActionClickedListener listener)
Sets the listener for Action click events.
Parameters | |
---|---|
listener |
OnActionClickedListener
|
void setSharedElementEnterTransition (Activity activity, String sharedElementName, long timeoutMs)
Sets the enter transition of target activity to be transiting into overview row created by this presenter. The transition will be cancelled if the overview image is not loaded in the timeout period.
It assumes shared element passed from calling activity is an ImageView; the shared element transits to overview image on the starting edge of the detail overview row, while bounds of overview row grows and reveals text and action buttons.
The method must be invoked in target Activity's onCreate().
Parameters | |
---|---|
activity |
Activity
|
sharedElementName |
String
|
timeoutMs |
long
|
void setSharedElementEnterTransition (Activity activity, String sharedElementName)
Sets the enter transition of target activity to be transiting into overview row created by this presenter. The transition will be cancelled if overview image is not loaded in a default timeout period.
It assumes shared element passed from calling activity is an ImageView; the shared element transits to overview image on the starting edge of the detail overview row, while bounds of overview row grows and reveals text and action buttons.
The method must be invoked in target Activity's onCreate().
Parameters | |
---|---|
activity |
Activity
|
sharedElementName |
String
|
void setStyleLarge (boolean large)
Sets the layout style to be large or small. This affects the height of the overview, including the text description. The default is large.
Parameters | |
---|---|
large |
boolean
|
RowPresenter.ViewHolder createRowViewHolder (ViewGroup parent)
Called to create a ViewHolder object for a Row. Subclasses will override this method to return a different concrete ViewHolder object.
Parameters | |
---|---|
parent |
ViewGroup :
The parent View for the Row's view holder. |
Returns | |
---|---|
RowPresenter.ViewHolder |
A ViewHolder for the Row's View. |
void onBindRowViewHolder (RowPresenter.ViewHolder holder, Object item)
Binds the given row object to the given ViewHolder.
Derived classes of RowPresenter
overriding
onBindRowViewHolder(ViewHolder, Object)
must call through the super class's
implementation of this method.
Parameters | |
---|---|
holder |
RowPresenter.ViewHolder
|
item |
Object
|
void onRowViewAttachedToWindow (RowPresenter.ViewHolder vh)
Invoked when the row view is attached to the window.
Parameters | |
---|---|
vh |
RowPresenter.ViewHolder
|
void onRowViewDetachedFromWindow (RowPresenter.ViewHolder vh)
Invoked when the row view is detached from the window.
Parameters | |
---|---|
vh |
RowPresenter.ViewHolder
|
void onRowViewSelected (RowPresenter.ViewHolder vh, boolean selected)
Called when the given row view changes selection state. A subclass may override this to respond to selected state changes of a Row. A subclass may make visual changes to Row view but must not create animation on the Row view.
Parameters | |
---|---|
vh |
RowPresenter.ViewHolder
|
selected |
boolean
|
void onSelectLevelChanged (RowPresenter.ViewHolder holder)
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.
Parameters | |
---|---|
holder |
RowPresenter.ViewHolder
|
void onUnbindRowViewHolder (RowPresenter.ViewHolder holder)
Unbinds the given ViewHolder.
Derived classes of RowPresenter
overriding onUnbindRowViewHolder(ViewHolder)
must call through the super class's implementation of this method.
Parameters | |
---|---|
holder |
RowPresenter.ViewHolder
|