RowHeaderPresenter

open class RowHeaderPresenter : Presenter
kotlin.Any
   ↳ androidx.leanback.widget.Presenter
   ↳ androidx.leanback.widget.RowHeaderPresenter

RowHeaderPresenter provides a default presentation for HeaderItem using a RowHeaderView and optionally a TextView for description. If a subclass creates its own view, the subclass must also override onCreateViewHolder(ViewGroup), onSelectLevelChanged(ViewHolder).

Summary

Nested classes

open

A ViewHolder for the RowHeaderPresenter.

Public constructors

Creates default RowHeaderPresenter using a title view and a description view.

Public methods

open Int

Returns the space (distance in pixels) below the baseline of the text view, if one exists; otherwise, returns 0.

open Boolean

Returns true if the view visibility is set to View#GONE when bound to null.

open Unit
onBindViewHolder(viewHolder: Presenter.ViewHolder!, item: Any!)

open Presenter.ViewHolder!

open Unit

open Unit
setNullItemVisibilityGone(nullItemVisibilityGone: Boolean)

Optionally sets the view visibility to View#GONE when bound to null.

Unit

Sets the select level.

Protected methods

open static Float
getFontDescent(textView: TextView!, fontMeasurePaint: Paint!)

open Unit

Called when the select level changes.

Inherited functions

Public constructors

<init>

RowHeaderPresenter()

Creates default RowHeaderPresenter using a title view and a description view.

See Also

  • ViewHolder#RowHeaderPresenter.ViewHolder(View)

Public methods

getSpaceUnderBaseline

open fun getSpaceUnderBaseline(holder: RowHeaderPresenter.ViewHolder!): Int

Returns the space (distance in pixels) below the baseline of the text view, if one exists; otherwise, returns 0.

isNullItemVisibilityGone

open fun isNullItemVisibilityGone(): Boolean

Returns true if the view visibility is set to View#GONE when bound to null.

onBindViewHolder

open fun onBindViewHolder(viewHolder: Presenter.ViewHolder!, item: Any!): Unit

onCreateViewHolder

open fun onCreateViewHolder(parent: ViewGroup!): Presenter.ViewHolder!

onUnbindViewHolder

open fun onUnbindViewHolder(viewHolder: Presenter.ViewHolder!): Unit

setNullItemVisibilityGone

open fun setNullItemVisibilityGone(nullItemVisibilityGone: Boolean): Unit

Optionally sets the view visibility to View#GONE when bound to null.

setSelectLevel

fun setSelectLevel(holder: RowHeaderPresenter.ViewHolder!, selectLevel: Float): Unit

Sets the select level.

Protected methods

getFontDescent

protected open static fun getFontDescent(textView: TextView!, fontMeasurePaint: Paint!): Float

onSelectLevelChanged

protected open fun onSelectLevelChanged(holder: RowHeaderPresenter.ViewHolder!): Unit

Called when the select level changes. The default implementation sets the alpha on the view.