ListRowPresenter.ViewHolder


class ListRowPresenter.ViewHolder : RowPresenter.ViewHolder


ViewHolder for the ListRowPresenter.

Summary

Public constructors

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

Public functions

ItemBridgeAdapter

Gets ItemBridgeAdapter that creates the list of items.

HorizontalGridView

Gets HorizontalGridView that shows a list of items.

Presenter.ViewHolder?

Gets ViewHolder at a position in adapter.

ListRowPresenter

Gets ListRowPresenter that creates this ViewHolder.

Any?

Return currently selected item inside a row ViewHolder.

Presenter.ViewHolder?

Return ViewHolder of currently selected item inside a row ViewHolder.

Int

Gets selected item position in adapter.

Inherited functions

From androidx.leanback.widget.FacetProvider
abstract Any?
getFacet(facetClass: Class<Any!>)

Queries optional implemented facet.

From androidx.leanback.widget.Presenter.ViewHolder
Any!
getFacet(facetClass: Class<Any!>!)

Queries optional implemented facet.

Unit
setFacet(facetClass: Class<Any!>!, facetImpl: Any!)

Sets dynamic implemented facet in addition to basic ViewHolder functions.

From androidx.leanback.widget.RowPresenter.ViewHolder
RowHeaderPresenter.ViewHolder!

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

BaseOnItemViewClickedListener!

Returns the listener for item click event.

BaseOnItemViewSelectedListener!

Returns the listener for item or row selection.

View.OnKeyListener!

Returns the key listener.

Row!

Returns the row bound to this ViewHolder.

Any!

Returns the Row object bound to this ViewHolder.

Float

Returns the current selection level of the Row.

Boolean

Returns whether the Row is in its expanded state.

Boolean

Returns whether the Row is selected.

Unit
setActivated(activated: Boolean)

Sets the row view's activated status.

Unit

Sets the listener for item click event.

Unit

Sets the listener for item or row selection.

Unit

Sets a key listener.

Unit

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

Public constructors

ViewHolder

Added in 1.1.0
ViewHolder(
    rootView: View,
    gridView: HorizontalGridView,
    p: ListRowPresenter
)

Public functions

getBridgeAdapter

Added in 1.1.0
fun getBridgeAdapter(): ItemBridgeAdapter

Gets ItemBridgeAdapter that creates the list of items.

Returns
ItemBridgeAdapter

ItemBridgeAdapter that creates the list of items.

getGridView

Added in 1.1.0
fun getGridView(): HorizontalGridView

Gets HorizontalGridView that shows a list of items.

Returns
HorizontalGridView

HorizontalGridView that shows a list of items.

getItemViewHolder

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

Returns
Presenter.ViewHolder?

ViewHolder bounds to the item.

getListRowPresenter

Added in 1.1.0
fun getListRowPresenter(): ListRowPresenter

Gets ListRowPresenter that creates this ViewHolder.

Returns
ListRowPresenter

ListRowPresenter that creates this ViewHolder.

getSelectedItem

fun getSelectedItem(): Any?

Return currently selected item inside a row ViewHolder.

Returns
Any?

The selected item.

getSelectedItemViewHolder

fun getSelectedItemViewHolder(): Presenter.ViewHolder?

Return ViewHolder of currently selected item inside a row ViewHolder.

Returns
Presenter.ViewHolder?

The selected item's ViewHolder.

getSelectedPosition

Added in 1.1.0
fun getSelectedPosition(): Int

Gets selected item position in adapter.

Returns
Int

Selected item position in adapter.