Android APIs
public static class

RowPresenter.ViewHolder

extends Presenter.ViewHolder
java.lang.Object
   ↳ android.support.v17.leanback.widget.Presenter.ViewHolder
     ↳ android.support.v17.leanback.widget.RowPresenter.ViewHolder
Known Direct Subclasses

Class Overview

A ViewHolder for a Row.

Summary

Fields
protected final ColorOverlayDimmer mColorDimmer
[Expand]
Inherited Fields
From class android.support.v17.leanback.widget.Presenter.ViewHolder
Public Constructors
RowPresenter.ViewHolder(View view)
Constructor for ViewHolder.
Public Methods
final RowHeaderPresenter.ViewHolder getHeaderViewHolder()
Returns the view holder for the Row header for this Row.
final OnItemViewClickedListener getOnItemViewClickedListener()
Returns the listener for item click event.
final OnItemViewSelectedListener getOnItemViewSelectedListener()
Returns the listener for item or row selection.
View.OnKeyListener getOnKeyListener()
Returns the key listener.
final Row getRow()
Returns the Row bound to the View in this ViewHolder.
final float getSelectLevel()
Returns the current selection level of the Row.
final boolean isExpanded()
Returns whether the Row is in its expanded state.
final boolean isSelected()
Returns whether the Row is selected.
final void setActivated(boolean activated)
Sets the row view's activated status.
final void setOnItemViewClickedListener(OnItemViewClickedListener listener)
Sets the listener for item click event.
final void setOnItemViewSelectedListener(OnItemViewSelectedListener listener)
Sets the listener for item or row selection.
void setOnKeyListener(View.OnKeyListener keyListener)
Sets a key listener.
final void syncActivatedStatus(View view)
Synchronizes the activated status of view to the last value passed through setActivated(boolean).
[Expand]
Inherited Methods
From class android.support.v17.leanback.widget.Presenter.ViewHolder
From class java.lang.Object
From interface android.support.v17.leanback.widget.FacetProvider

Fields

protected final ColorOverlayDimmer mColorDimmer

Public Constructors

public RowPresenter.ViewHolder (View view)

Constructor for ViewHolder.

Parameters
view The View bound to the Row.

Public Methods

public final RowHeaderPresenter.ViewHolder getHeaderViewHolder ()

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

public final OnItemViewClickedListener getOnItemViewClickedListener ()

Returns the listener for item click event.

public final OnItemViewSelectedListener getOnItemViewSelectedListener ()

Returns the listener for item or row selection.

public View.OnKeyListener getOnKeyListener ()

Returns the key listener.

public final Row getRow ()

Returns the Row bound to the View in this ViewHolder.

public final float getSelectLevel ()

Returns the current selection level of the Row.

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 void setActivated (boolean activated)

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

public final void setOnItemViewClickedListener (OnItemViewClickedListener 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(ViewGroup).

public final void setOnItemViewSelectedListener (OnItemViewSelectedListener 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 void setOnKeyListener (View.OnKeyListener keyListener)

Sets a key listener.

public final void syncActivatedStatus (View view)

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