added in version 22.1.0
belongs to Maven artifact com.android.support:leanback-v17:28.0.0-alpha1

RowHeaderPresenter

public class RowHeaderPresenter
extends Presenter

java.lang.Object
   ↳ android.support.v17.leanback.widget.Presenter
     ↳ android.support.v17.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

class RowHeaderPresenter.ViewHolder

A ViewHolder for the RowHeaderPresenter. 

Public constructors

RowHeaderPresenter()

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

Public methods

int getSpaceUnderBaseline(RowHeaderPresenter.ViewHolder holder)

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

boolean isNullItemVisibilityGone()

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

void onBindViewHolder(Presenter.ViewHolder viewHolder, Object item)

Binds a View to an item.

Presenter.ViewHolder onCreateViewHolder(ViewGroup parent)

Creates a new View.

void onUnbindViewHolder(Presenter.ViewHolder viewHolder)

Unbinds a View from an item.

void setNullItemVisibilityGone(boolean nullItemVisibilityGone)

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

final void setSelectLevel(RowHeaderPresenter.ViewHolder holder, float selectLevel)

Sets the select level.

Protected methods

static float getFontDescent(TextView textView, Paint fontMeasurePaint)
void onSelectLevelChanged(RowHeaderPresenter.ViewHolder holder)

Called when the select level changes.

Inherited methods

From class android.support.v17.leanback.widget.Presenter
From class java.lang.Object
From interface android.support.v17.leanback.widget.FacetProvider

Public constructors

RowHeaderPresenter

added in version 22.1.0
RowHeaderPresenter ()

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

Public methods

getSpaceUnderBaseline

added in version 22.1.0
int getSpaceUnderBaseline (RowHeaderPresenter.ViewHolder holder)

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

Parameters
holder RowHeaderPresenter.ViewHolder

Returns
int

isNullItemVisibilityGone

added in version 22.1.0
boolean isNullItemVisibilityGone ()

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

Returns
boolean

onBindViewHolder

added in version 22.1.0
void onBindViewHolder (Presenter.ViewHolder viewHolder, 
                Object item)

Binds a View to an item.

Parameters
viewHolder Presenter.ViewHolder

item Object

onCreateViewHolder

added in version 22.1.0
Presenter.ViewHolder onCreateViewHolder (ViewGroup parent)

Creates a new View.

Parameters
parent ViewGroup

Returns
Presenter.ViewHolder

onUnbindViewHolder

added in version 22.1.0
void onUnbindViewHolder (Presenter.ViewHolder viewHolder)

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.

Parameters
viewHolder Presenter.ViewHolder

setNullItemVisibilityGone

added in version 22.1.0
void setNullItemVisibilityGone (boolean nullItemVisibilityGone)

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

Parameters
nullItemVisibilityGone boolean

setSelectLevel

added in version 22.1.0
void setSelectLevel (RowHeaderPresenter.ViewHolder holder, 
                float selectLevel)

Sets the select level.

Parameters
holder RowHeaderPresenter.ViewHolder

selectLevel float

Protected methods

getFontDescent

added in version 22.1.0
float getFontDescent (TextView textView, 
                Paint fontMeasurePaint)

Parameters
textView TextView

fontMeasurePaint Paint

Returns
float

onSelectLevelChanged

added in version 22.1.0
void onSelectLevelChanged (RowHeaderPresenter.ViewHolder holder)

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

Parameters
holder RowHeaderPresenter.ViewHolder