RowHeaderPresenter


class RowHeaderPresenter : Presenter


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, onSelectLevelChanged.

Summary

Nested types

A ViewHolder for the RowHeaderPresenter.

Public constructors

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

Public functions

Int

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

Boolean

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

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

Binds a View to an item.

Presenter.ViewHolder

Creates a new View.

Unit

Unbinds a View from an item.

Unit
setNullItemVisibilityGone(nullItemVisibilityGone: Boolean)

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

Unit

Sets the select level.

Protected functions

java-static Float
getFontDescent(textView: TextView, fontMeasurePaint: Paint)
Unit

Called when the select level changes.

Inherited functions

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

Queries optional implemented facet.

From androidx.leanback.widget.Presenter
java-static Unit

Utility method for removing all running animations on a view.

Any!
getFacet(facetClass: Class<Any!>!)

Queries optional implemented facet.

Unit
onBindViewHolder(
    viewHolder: Presenter.ViewHolder,
    item: Any,
    payloads: (Mutable)List<Any!>
)

Binds a View to an item with a list of payloads.

Unit

Called when a view created by this presenter has been attached to a window.

Unit

Called when a view created by this presenter has been detached from its window.

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

Sets dynamic implemented facet in addition to basic Presenter functions.

Unit
setOnClickListener(
    holder: Presenter.ViewHolder!,
    listener: View.OnClickListener!
)

Called to set a click listener for the given view holder.

Public constructors

RowHeaderPresenter

Added in 1.1.0
RowHeaderPresenter()

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

Public functions

getSpaceUnderBaseline

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

Added in 1.1.0
fun isNullItemVisibilityGone(): Boolean

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

onBindViewHolder

Added in 1.2.0-alpha04
fun onBindViewHolder(viewHolder: Presenter.ViewHolder, item: Any?): Unit

Binds a View to an item.

onCreateViewHolder

Added in 1.2.0-alpha04
fun onCreateViewHolder(parent: ViewGroup): Presenter.ViewHolder

Creates a new View.

onUnbindViewHolder

Added in 1.2.0-alpha04
fun onUnbindViewHolder(viewHolder: Presenter.ViewHolder): Unit

Unbinds a View from an item. Any expensive references may be released here, and any fields that are not bound for every item should be cleared here.

setNullItemVisibilityGone

Added in 1.1.0
fun setNullItemVisibilityGone(nullItemVisibilityGone: Boolean): Unit

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

setSelectLevel

Added in 1.1.0
fun setSelectLevel(holder: RowHeaderPresenter.ViewHolder, selectLevel: Float): Unit

Sets the select level.

Protected functions

getFontDescent

Added in 1.1.0
protected java-static fun getFontDescent(textView: TextView, fontMeasurePaint: Paint): Float

onSelectLevelChanged

Added in 1.1.0
protected fun onSelectLevelChanged(holder: RowHeaderPresenter.ViewHolder): Unit

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