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 Unit
setNullItemVisibilityGone(nullItemVisibilityGone: Boolean)

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

Unit

Sets the select level.

open Presenter.ViewHolder!

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

open Unit

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.

Protected methods
open Unit

Called when the select level changes.

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

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

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.

onCreateViewHolder

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

onBindViewHolder

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

onUnbindViewHolder

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

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.

Protected methods

onSelectLevelChanged

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

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

getFontDescent

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