RowPresenter.ViewHolder


class RowPresenter.ViewHolder : Presenter.ViewHolder

Known indirect subclasses
PlaybackControlsRowPresenter.ViewHolder

A ViewHolder for the PlaybackControlsRow.

PlaybackTransportRowPresenter.ViewHolder

A ViewHolder for the PlaybackControlsRow supporting seek UI.


A ViewHolder for a Row.

Summary

Public constructors

ViewHolder(view: View!)

Constructor for ViewHolder.

Public functions

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.

Any?

Return currently selected item inside a row ViewHolder.

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.

Unit

Sets a key listener.

Unit

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

Protected properties

ColorOverlayDimmer!

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.

Public constructors

ViewHolder

Added in 1.2.0-alpha04
ViewHolder(view: View!)

Constructor for ViewHolder.

Parameters
view: View!

The View bound to the Row.

Public functions

getHeaderViewHolder

Added in 1.1.0
fun getHeaderViewHolder(): RowHeaderPresenter.ViewHolder!

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

getOnItemViewClickedListener

Added in 1.1.0
fun getOnItemViewClickedListener(): BaseOnItemViewClickedListener!

Returns the listener for item click event.

getOnItemViewSelectedListener

Added in 1.1.0
fun getOnItemViewSelectedListener(): BaseOnItemViewSelectedListener!

Returns the listener for item or row selection.

getOnKeyListener

Added in 1.1.0
fun getOnKeyListener(): View.OnKeyListener!

Returns the key listener.

getRow

Added in 1.1.0
fun getRow(): Row!

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

Returns
Row!

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

getRowObject

Added in 1.1.0
fun getRowObject(): Any!

Returns the Row object bound to this ViewHolder.

Returns
Any!

The row object bound to this ViewHolder.

getSelectLevel

Added in 1.1.0
fun getSelectLevel(): Float

Returns the current selection level of the Row.

getSelectedItem

Added in 1.1.0
fun getSelectedItem(): Any?

Return currently selected item inside a row ViewHolder.

Returns
Any?

The selected item.

getSelectedItemViewHolder

Added in 1.1.0
fun getSelectedItemViewHolder(): Presenter.ViewHolder?

Return ViewHolder of currently selected item inside a row ViewHolder.

Returns
Presenter.ViewHolder?

The selected item's ViewHolder.

isExpanded

Added in 1.1.0
fun isExpanded(): Boolean

Returns whether the Row is in its expanded state.

Returns
Boolean

true if the Row is expanded, false otherwise.

isSelected

Added in 1.1.0
fun isSelected(): Boolean

Returns whether the Row is selected.

Returns
Boolean

true if the Row is selected, false otherwise.

setActivated

Added in 1.1.0
fun setActivated(activated: Boolean): Unit

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

setOnItemViewClickedListener

Added in 1.1.0
fun setOnItemViewClickedListener(listener: BaseOnItemViewClickedListener!): Unit

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.

setOnItemViewSelectedListener

Added in 1.1.0
fun setOnItemViewSelectedListener(listener: BaseOnItemViewSelectedListener!): Unit

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.

setOnKeyListener

Added in 1.1.0
fun setOnKeyListener(keyListener: View.OnKeyListener!): Unit

Sets a key listener.

syncActivatedStatus

Added in 1.1.0
fun syncActivatedStatus(view: View!): Unit

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

Protected properties

mColorDimmer

Added in 1.1.0
protected val mColorDimmerColorOverlayDimmer!