RowPresenter.ViewHolder


public class RowPresenter.ViewHolder extends Presenter.ViewHolder

Known indirect subclasses
PlaybackControlsRowPresenter.ViewHolder

A ViewHolder for the PlaybackControlsRow.

PlaybackTransportRowPresenter.ViewHolder

A ViewHolder for the PlaybackControlsRow supporting seek UI.


A ViewHolder for a Row.

Summary

Protected fields

final ColorOverlayDimmer

Public constructors

Constructor for ViewHolder.

Public methods

final RowHeaderPresenter.ViewHolder

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

final BaseOnItemViewClickedListener

Returns the listener for item click event.

final BaseOnItemViewSelectedListener

Returns the listener for item or row selection.

View.OnKeyListener

Returns the key listener.

final Row

Returns the row bound to this ViewHolder.

final Object

Returns the Row object bound to this ViewHolder.

final float

Returns the current selection level of the Row.

@Nullable Object

Return currently selected item inside a row ViewHolder.

@Nullable Presenter.ViewHolder

Return ViewHolder of currently selected item inside a row ViewHolder.

final boolean

Returns whether the Row is in its expanded state.

final boolean

Returns whether the Row is selected.

final void
setActivated(boolean activated)

Sets the row view's activated status.

final void

Sets the listener for item click event.

final void

Sets the listener for item or row selection.

void

Sets a key listener.

final void

Synchronizes the activated status of view to the last value passed through setActivated.

Inherited methods

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

Queries optional implemented facet.

From androidx.leanback.widget.Presenter.ViewHolder
final Object
getFacet(Class<Object> facetClass)

Queries optional implemented facet.

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

Sets dynamic implemented facet in addition to basic ViewHolder functions.

Protected fields

mColorDimmer

Added in 1.1.0
protected final ColorOverlayDimmer mColorDimmer

Public constructors

ViewHolder

Added in 1.2.0-alpha04
public ViewHolder(View view)

Constructor for ViewHolder.

Parameters
View view

The View bound to the Row.

Public methods

getHeaderViewHolder

Added in 1.1.0
public final RowHeaderPresenter.ViewHolder getHeaderViewHolder()

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

getOnItemViewClickedListener

Added in 1.1.0
public final BaseOnItemViewClickedListener getOnItemViewClickedListener()

Returns the listener for item click event.

getOnItemViewSelectedListener

Added in 1.1.0
public final BaseOnItemViewSelectedListener getOnItemViewSelectedListener()

Returns the listener for item or row selection.

getOnKeyListener

Added in 1.1.0
public View.OnKeyListener getOnKeyListener()

Returns the key listener.

getRow

Added in 1.1.0
public final Row getRow()

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

Returns
Row

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

getRowObject

Added in 1.1.0
public final Object getRowObject()

Returns the Row object bound to this ViewHolder.

Returns
Object

The row object bound to this ViewHolder.

getSelectLevel

Added in 1.1.0
public final float getSelectLevel()

Returns the current selection level of the Row.

getSelectedItem

Added in 1.1.0
public @Nullable Object getSelectedItem()

Return currently selected item inside a row ViewHolder.

Returns
@Nullable Object

The selected item.

getSelectedItemViewHolder

Added in 1.1.0
public @Nullable Presenter.ViewHolder getSelectedItemViewHolder()

Return ViewHolder of currently selected item inside a row ViewHolder.

Returns
@Nullable Presenter.ViewHolder

The selected item's ViewHolder.

isExpanded

Added in 1.1.0
public final boolean isExpanded()

Returns whether the Row is in its expanded state.

Returns
boolean

true if the Row is expanded, false otherwise.

isSelected

Added in 1.1.0
public final boolean isSelected()

Returns whether the Row is selected.

Returns
boolean

true if the Row is selected, false otherwise.

setActivated

Added in 1.1.0
public final void setActivated(boolean activated)

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

setOnItemViewClickedListener

Added in 1.1.0
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 View.OnClickListener that item presenter sets during onCreateViewHolder.

setOnItemViewSelectedListener

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

setOnKeyListener

Added in 1.1.0
public void setOnKeyListener(View.OnKeyListener keyListener)

Sets a key listener.

syncActivatedStatus

Added in 1.1.0
public final void syncActivatedStatus(View view)

Synchronizes the activated status of view to the last value passed through setActivated. No operation if setActivated 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.