Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

ViewHolder

open class ViewHolder : RowPresenter.ViewHolder
kotlin.Any
   ↳ androidx.leanback.widget.Presenter.ViewHolder
   ↳ androidx.leanback.widget.RowPresenter.ViewHolder
   ↳ androidx.leanback.widget.ListRowPresenter.ViewHolder

ViewHolder for the ListRowPresenter.

Summary

Public constructors
<init>(rootView: View!, gridView: HorizontalGridView!, p: ListRowPresenter!)

Public methods
ListRowPresenter!

Gets ListRowPresenter that creates this ViewHolder.

open Any!

open Int

Gets selected item position in adapter.

HorizontalGridView!

Gets HorizontalGridView that shows a list of items.

ItemBridgeAdapter!

Gets ItemBridgeAdapter that creates the list of items.

open Presenter.ViewHolder!

open Presenter.ViewHolder!

Gets ViewHolder at a position in adapter.

Inherited functions
Inherited properties

Public constructors

<init>

ViewHolder(rootView: View!, gridView: HorizontalGridView!, p: ListRowPresenter!)

Public methods

getListRowPresenter

fun getListRowPresenter(): ListRowPresenter!

Gets ListRowPresenter that creates this ViewHolder.

Return
ListRowPresenter!: ListRowPresenter that creates this ViewHolder.

getSelectedItem

open fun getSelectedItem(): Any!

getSelectedPosition

open fun getSelectedPosition(): Int

Gets selected item position in adapter.

Return
Int: Selected item position in adapter.

getGridView

fun getGridView(): HorizontalGridView!

Gets HorizontalGridView that shows a list of items.

Return
HorizontalGridView!: HorizontalGridView that shows a list of items.

getBridgeAdapter

fun getBridgeAdapter(): ItemBridgeAdapter!

Gets ItemBridgeAdapter that creates the list of items.

Return
ItemBridgeAdapter!: ItemBridgeAdapter that creates the list of items.

getSelectedItemViewHolder

open fun getSelectedItemViewHolder(): Presenter.ViewHolder!

getItemViewHolder

open fun getItemViewHolder(position: Int): Presenter.ViewHolder!

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.
Return
Presenter.ViewHolder!: ViewHolder bounds to the item.