public class

RowPresenter.ViewHolder

extends Presenter.ViewHolder

 java.lang.Object

androidx.leanback.widget.Presenter.ViewHolder

↳androidx.leanback.widget.RowPresenter.ViewHolder

Subclasses:

PlaybackTransportRowPresenter.ViewHolder, FullWidthDetailsOverviewRowPresenter.ViewHolder, AbstractMediaListHeaderPresenter.ViewHolder, PlaybackControlsRowPresenter.ViewHolder, PlaybackRowPresenter.ViewHolder, ListRowPresenter.ViewHolder, AbstractMediaItemPresenter.ViewHolder, DetailsOverviewRowPresenter.ViewHolder

Overview

A ViewHolder for a Row.

Summary

Fields
protected final ColorOverlayDimmermColorDimmer

from Presenter.ViewHolderview
Constructors
publicViewHolder(View view)

Constructor for ViewHolder.

Methods
public final RowHeaderPresenter.ViewHoldergetHeaderViewHolder()

Returns the view holder for the Row header for this Row.

public final BaseOnItemViewClickedListenergetOnItemViewClickedListener()

Returns the listener for item click event.

public final BaseOnItemViewSelectedListenergetOnItemViewSelectedListener()

Returns the listener for item or row selection.

public View.OnKeyListenergetOnKeyListener()

Returns the key listener.

public final RowgetRow()

Returns the row bound to this ViewHolder.

public final java.lang.ObjectgetRowObject()

Returns the Row object bound to this ViewHolder.

public java.lang.ObjectgetSelectedItem()

Return currently selected item inside a row ViewHolder.

public Presenter.ViewHoldergetSelectedItemViewHolder()

Return RowPresenter.ViewHolder of currently selected item inside a row ViewHolder.

public final floatgetSelectLevel()

Returns the current selection level of the Row.

public final booleanisExpanded()

Returns whether the Row is in its expanded state.

public final booleanisSelected()

Returns whether the Row is selected.

public final voidsetActivated(boolean activated)

Sets the row view's activated status.

public final voidsetOnItemViewClickedListener(BaseOnItemViewClickedListener listener)

Sets the listener for item click event.

public final voidsetOnItemViewSelectedListener(BaseOnItemViewSelectedListener listener)

Sets the listener for item or row selection.

public voidsetOnKeyListener(View.OnKeyListener keyListener)

Sets a key listener.

public final voidsyncActivatedStatus(View view)

Synchronizes the activated status of view to the last value passed through RowPresenter.ViewHolder.setActivated(boolean).

from Presenter.ViewHoldergetFacet, setFacet
from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Fields

protected final ColorOverlayDimmer mColorDimmer

Constructors

public ViewHolder(View view)

Constructor for ViewHolder.

Parameters:

view: The View bound to the Row.

Methods

public final Row getRow()

Returns the row bound to this ViewHolder. Returns null if the row is not an instance of Row.

Returns:

The row bound to this ViewHolder. Returns null if the row is not an instance of Row.

public final java.lang.Object getRowObject()

Returns the Row object bound to this ViewHolder.

Returns:

The row object bound to this ViewHolder.

public final boolean isExpanded()

Returns whether the Row is in its expanded state.

Returns:

true if the Row is expanded, false otherwise.

public final boolean isSelected()

Returns whether the Row is selected.

Returns:

true if the Row is selected, false otherwise.

public final float getSelectLevel()

Returns the current selection level of the Row.

public final RowHeaderPresenter.ViewHolder getHeaderViewHolder()

Returns the view holder for the Row header for this Row.

public final void setActivated(boolean activated)

Sets the row view's activated status. The status will be applied to children through RowPresenter.ViewHolder.syncActivatedStatus(View). Application should only call this function when RowPresenter.getSyncActivatePolicy() is RowPresenter.SYNC_ACTIVATED_CUSTOM; otherwise the value will be overwritten when expanded or selected status changes.

public final void syncActivatedStatus(View view)

Synchronizes the activated status of view to the last value passed through RowPresenter.ViewHolder.setActivated(boolean). No operation if RowPresenter.ViewHolder.setActivated(boolean) is never called. Normally application does not need to call this method, ListRowPresenter automatically calls this method when a child is attached to list row. However if application writes its own custom RowPresenter, it should call this method when attaches a child to the row view.

public void setOnKeyListener(View.OnKeyListener keyListener)

Sets a key listener.

public View.OnKeyListener getOnKeyListener()

Returns the key listener.

public final void setOnItemViewSelectedListener(BaseOnItemViewSelectedListener listener)

Sets the listener for item or row selection. RowPresenter fires row selection event with null item. A subclass of RowPresenter e.g. ListRowPresenter may fire a selection event with selected item.

public final BaseOnItemViewSelectedListener getOnItemViewSelectedListener()

Returns the listener for item or row selection.

public final void setOnItemViewClickedListener(BaseOnItemViewClickedListener listener)

Sets the listener for item click event. RowPresenter does nothing but subclass of RowPresenter may fire item click event if it has the concept of item. OnItemViewClickedListener will override that item presenter sets during Presenter.onCreateViewHolder(ViewGroup).

public final BaseOnItemViewClickedListener getOnItemViewClickedListener()

Returns the listener for item click event.

public Presenter.ViewHolder getSelectedItemViewHolder()

Return RowPresenter.ViewHolder of currently selected item inside a row ViewHolder.

Returns:

The selected item's ViewHolder.

public java.lang.Object getSelectedItem()

Return currently selected item inside a row ViewHolder.

Returns:

The selected item.