Google 致力于为黑人社区推动种族平等。查看具体举措

ViewHolder

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

A ViewHolder for a Row.

Summary

Public constructors
<init>(view: View!)

Constructor for ViewHolder.

Public methods
RowHeaderPresenter.ViewHolder!

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

BaseOnItemViewClickedListener<Any!>!

Returns the listener for item click event.

BaseOnItemViewSelectedListener<Any!>!

Returns the listener for item or row selection.

open 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.

open Any!

Return currently selected item inside a row ViewHolder.

open Presenter.ViewHolder!

Return ViewHolder of currently selected item inside a row ViewHolder.

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.

open Unit

Sets a key listener.

Unit

Synchronizes the activated status of view to the last value passed through RowPresenter.ViewHolder#setActivated(boolean).

Inherited functions
Properties
ColorOverlayDimmer!

Inherited properties

Public constructors

<init>

ViewHolder(view: View!)

Constructor for ViewHolder.

Parameters
view View!: The View bound to the Row.

Public methods

getHeaderViewHolder

fun getHeaderViewHolder(): RowHeaderPresenter.ViewHolder!

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

getOnItemViewClickedListener

fun getOnItemViewClickedListener(): BaseOnItemViewClickedListener<Any!>!

Returns the listener for item click event.

getOnItemViewSelectedListener

fun getOnItemViewSelectedListener(): BaseOnItemViewSelectedListener<Any!>!

Returns the listener for item or row selection.

getOnKeyListener

open fun getOnKeyListener(): OnKeyListener!

Returns the key listener.

getRow

fun getRow(): Row!

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

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

getRowObject

fun getRowObject(): Any!

Returns the Row object bound to this ViewHolder.

Return
Any! The row object bound to this ViewHolder.

getSelectLevel

fun getSelectLevel(): Float

Returns the current selection level of the Row.

getSelectedItem

open fun getSelectedItem(): Any!

Return currently selected item inside a row ViewHolder.

Return
Any! The selected item.

getSelectedItemViewHolder

open fun getSelectedItemViewHolder(): Presenter.ViewHolder!

Return ViewHolder of currently selected item inside a row ViewHolder.

Return
Presenter.ViewHolder! The selected item's ViewHolder.