DetailsOverviewRowPresenter

Added in 1.1.0
Deprecated in 1.1.0

public class DetailsOverviewRowPresenter extends RowPresenter


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. 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 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.

Summary

Nested types

This class is deprecated. Deprecated in Java

Public constructors

This method is deprecated. Deprecated in Java

Public methods

@ColorInt int

This method is deprecated. Deprecated in Java

OnActionClickedListener

This method is deprecated. Deprecated in Java

boolean

This method is deprecated. Deprecated in Java

final boolean

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

final void
setSharedElementEnterTransition(
    Activity activity,
    String sharedElementName
)

This method is deprecated. Deprecated in Java

final void
setSharedElementEnterTransition(
    Activity activity,
    String sharedElementName,
    long timeoutMs
)

This method is deprecated. Deprecated in Java

void
setStyleLarge(boolean large)

This method is deprecated. Deprecated in Java

Protected methods

RowPresenter.ViewHolder

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

Inherited Constants

From androidx.leanback.widget.RowPresenter
static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

Inherited methods

From androidx.leanback.widget.FacetProvider
abstract @Nullable Object
getFacet(@NonNull Class<@NonNull ?> facetClass)

This method is deprecated. Deprecated in Java

From androidx.leanback.widget.Presenter
static void

This method is deprecated. Deprecated in Java

final Object
getFacet(Class<@NonNull ?> facetClass)

This method is deprecated. Deprecated in Java

abstract void
onBindViewHolder(
    @NonNull Presenter.ViewHolder viewHolder,
    @Nullable Object item
)

This method is deprecated. Deprecated in Java

void
onBindViewHolder(
    @NonNull Presenter.ViewHolder viewHolder,
    @NonNull Object item,
    @NonNull List<Object> payloads
)

This method is deprecated. Deprecated in Java

abstract @NonNull Presenter.ViewHolder

This method is deprecated. Deprecated in Java

abstract void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

final void
setFacet(Class<@NonNull ?> facetClass, Object facetImpl)

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

From androidx.leanback.widget.RowPresenter
void
dispatchItemSelectedListener(
    RowPresenter.ViewHolder vh,
    boolean selected
)

This method is deprecated. Deprecated in Java

void
freeze(@NonNull RowPresenter.ViewHolder holder, boolean freeze)

This method is deprecated. Deprecated in Java

final RowHeaderPresenter

This method is deprecated. Deprecated in Java

final RowPresenter.ViewHolder

This method is deprecated. Deprecated in Java

final boolean

This method is deprecated. Deprecated in Java

final float

This method is deprecated. Deprecated in Java

final int

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

boolean

This method is deprecated. Deprecated in Java

final void
onBindViewHolder(
    @NonNull Presenter.ViewHolder viewHolder,
    @Nullable Object item
)

This method is deprecated. Deprecated in Java

final Presenter.ViewHolder

This method is deprecated. Deprecated in Java

void

This method is deprecated. Deprecated in Java

final void

This method is deprecated. Deprecated in Java

final void

This method is deprecated. Deprecated in Java

final void

This method is deprecated. Deprecated in Java

void
setEntranceTransitionState(
    @NonNull RowPresenter.ViewHolder holder,
    boolean afterEntrance
)

This method is deprecated. Deprecated in Java

final void

This method is deprecated. Deprecated in Java

final void
setRowViewExpanded(Presenter.ViewHolder holder, boolean expanded)

This method is deprecated. Deprecated in Java

final void
setRowViewSelected(Presenter.ViewHolder holder, boolean selected)

This method is deprecated. Deprecated in Java

final void
setSelectEffectEnabled(boolean applyDimOnSelect)

This method is deprecated. Deprecated in Java

final void

This method is deprecated. Deprecated in Java

final void
setSyncActivatePolicy(int syncActivatePolicy)

This method is deprecated. Deprecated in Java

Public constructors

DetailsOverviewRowPresenter

Added in 1.1.0
Deprecated in 1.1.0
public DetailsOverviewRowPresenter(Presenter detailsPresenter)

Constructor for a DetailsOverviewRowPresenter.

Parameters
Presenter detailsPresenter

The Presenter used to render the detailed description of the row.

Public methods

getBackgroundColor

Added in 1.1.0
Deprecated in 1.1.0
public @ColorInt int getBackgroundColor()

Returns the background color. If no background color was set, transparent is returned.

getOnActionClickedListener

Added in 1.1.0
Deprecated in 1.1.0
public OnActionClickedListener getOnActionClickedListener()

Returns the listener for Action click events.

isStyleLarge

Added in 1.1.0
Deprecated in 1.1.0
public boolean isStyleLarge()

Returns true if the layout style is large.

isUsingDefaultSelectEffect

public final boolean isUsingDefaultSelectEffect()

Returns true if this RowPresenter is using the default dimming effect. A subclass may (most likely) return false and override onSelectLevelChanged.

setBackgroundColor

Added in 1.1.0
Deprecated in 1.1.0
public void setBackgroundColor(@ColorInt int color)

Sets the background color. If not set, a default from the theme will be used.

setOnActionClickedListener

Added in 1.1.0
Deprecated in 1.1.0
public void setOnActionClickedListener(OnActionClickedListener listener)

Sets the listener for Action click events.

setSharedElementEnterTransition

Added in 1.1.0
Deprecated in 1.1.0
public final 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().

setSharedElementEnterTransition

Added in 1.1.0
Deprecated in 1.1.0
public 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. 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().

setStyleLarge

Added in 1.1.0
Deprecated in 1.1.0
public 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.

Protected methods

createRowViewHolder

protected 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
ViewGroup parent

The parent View for the Row's view holder.

Returns
RowPresenter.ViewHolder

A ViewHolder for the Row's View.

onBindRowViewHolder

protected void onBindRowViewHolder(
    @NonNull RowPresenter.ViewHolder holder,
    @NonNull Object item
)

Binds the given row object to the given ViewHolder. Derived classes of RowPresenter overriding onBindRowViewHolder must call through the super class's implementation of this method.

onRowViewAttachedToWindow

protected void onRowViewAttachedToWindow(@NonNull RowPresenter.ViewHolder vh)

Invoked when the row view is attached to the window.

onRowViewDetachedFromWindow

protected void onRowViewDetachedFromWindow(@NonNull RowPresenter.ViewHolder vh)

Invoked when the row view is detached from the window.

onRowViewSelected

protected 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.

onSelectLevelChanged

protected void onSelectLevelChanged(RowPresenter.ViewHolder holder)

Callback when the select level changes. The default implementation applies the select level to setSelectLevel 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.

onUnbindRowViewHolder

protected void onUnbindRowViewHolder(@NonNull RowPresenter.ViewHolder holder)

Unbinds the given ViewHolder. Derived classes of RowPresenter overriding onUnbindRowViewHolder must call through the super class's implementation of this method.