Most visited

Recently visited

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. If a subclass creates its own view, the subclass must also override onSelectLevelChanged(ViewHolder).

Summary

Nested classes

class RowHeaderPresenter.ViewHolder

A ViewHolder for the RowHeaderPresenter. 

Public constructors

RowHeaderPresenter()

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

RowHeaderPresenter ()

Public methods

getSpaceUnderBaseline

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

boolean isNullItemVisibilityGone ()

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

Returns
boolean

onBindViewHolder

void onBindViewHolder (Presenter.ViewHolder viewHolder, 
                Object item)

Binds a View to an item.

Parameters
viewHolder Presenter.ViewHolder
item Object

onCreateViewHolder

Presenter.ViewHolder onCreateViewHolder (ViewGroup parent)

Creates a new View.

Parameters
parent ViewGroup
Returns
Presenter.ViewHolder

onUnbindViewHolder

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

void setNullItemVisibilityGone (boolean nullItemVisibilityGone)

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

Parameters
nullItemVisibilityGone boolean

setSelectLevel

void setSelectLevel (RowHeaderPresenter.ViewHolder holder, 
                float selectLevel)

Sets the select level.

Parameters
holder RowHeaderPresenter.ViewHolder
selectLevel float

Protected methods

getFontDescent

float getFontDescent (TextView textView, 
                Paint fontMeasurePaint)

Parameters
textView TextView
fontMeasurePaint Paint
Returns
float

onSelectLevelChanged

void onSelectLevelChanged (RowHeaderPresenter.ViewHolder holder)

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

Parameters
holder RowHeaderPresenter.ViewHolder

Hooray!