lightbulb_outline Please take our October 2018 developer survey. Start survey
added in version 1.0.0
belongs to Maven artifact androidx.leanback:leanback:1.0.0

ListRowPresenter.ViewHolder

public static class ListRowPresenter.ViewHolder
extends RowPresenter.ViewHolder

java.lang.Object
   ↳ androidx.leanback.widget.Presenter.ViewHolder
     ↳ androidx.leanback.widget.RowPresenter.ViewHolder
       ↳ androidx.leanback.widget.ListRowPresenter.ViewHolder


ViewHolder for the ListRowPresenter.

Summary

Inherited fields

Public constructors

ListRowPresenter.ViewHolder(View rootView, HorizontalGridView gridView, ListRowPresenter p)

Public methods

final ItemBridgeAdapter getBridgeAdapter()

Gets ItemBridgeAdapter that creates the list of items.

final HorizontalGridView getGridView()

Gets HorizontalGridView that shows a list of items.

Presenter.ViewHolder getItemViewHolder(int position)

Gets ViewHolder at a position in adapter.

final ListRowPresenter getListRowPresenter()

Gets ListRowPresenter that creates this ViewHolder.

Object getSelectedItem()

Return currently selected item inside a row ViewHolder.

Presenter.ViewHolder getSelectedItemViewHolder()

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

int getSelectedPosition()

Gets selected item position in adapter.

Inherited methods

Public constructors

ListRowPresenter.ViewHolder

added in version 1.0.0
public ListRowPresenter.ViewHolder (View rootView, 
                HorizontalGridView gridView, 
                ListRowPresenter p)

Parameters
rootView View

gridView HorizontalGridView

p ListRowPresenter

Public methods

getBridgeAdapter

added in version 1.0.0
public final ItemBridgeAdapter getBridgeAdapter ()

Gets ItemBridgeAdapter that creates the list of items.

Returns
ItemBridgeAdapter ItemBridgeAdapter that creates the list of items.

getGridView

added in version 1.0.0
public final HorizontalGridView getGridView ()

Gets HorizontalGridView that shows a list of items.

Returns
HorizontalGridView HorizontalGridView that shows a list of items.

getItemViewHolder

added in version 1.0.0
public Presenter.ViewHolder getItemViewHolder (int position)

Gets ViewHolder at a position in adapter. Returns null if the item does not exist or the item is not bound to a view.

Parameters
position int: Position of the item in adapter.

Returns
Presenter.ViewHolder ViewHolder bounds to the item.

getListRowPresenter

added in version 1.0.0
public final ListRowPresenter getListRowPresenter ()

Gets ListRowPresenter that creates this ViewHolder.

Returns
ListRowPresenter ListRowPresenter that creates this ViewHolder.

getSelectedItem

added in version 1.0.0
public Object getSelectedItem ()

Return currently selected item inside a row ViewHolder.

Returns
Object The selected item.

getSelectedItemViewHolder

added in version 1.0.0
public Presenter.ViewHolder getSelectedItemViewHolder ()

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

Returns
Presenter.ViewHolder The selected item's ViewHolder.

getSelectedPosition

added in version 1.0.0
public int getSelectedPosition ()

Gets selected item position in adapter.

Returns
int Selected item position in adapter.