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)
.
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 |
void
|
onBindViewHolder(Presenter.ViewHolder viewHolder, Object item)
Binds a |
Presenter.ViewHolder
|
onCreateViewHolder(ViewGroup parent)
Creates a new |
void
|
onUnbindViewHolder(Presenter.ViewHolder viewHolder)
Unbinds a |
void
|
setNullItemVisibilityGone(boolean nullItemVisibilityGone)
Optionally sets the view visibility to |
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
|
RowHeaderPresenter ()
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 |
boolean isNullItemVisibilityGone ()
Returns true if the view visibility is set to GONE
when bound to null.
Returns | |
---|---|
boolean |
void onBindViewHolder (Presenter.ViewHolder viewHolder, Object item)
Binds a View
to an item.
Parameters | |
---|---|
viewHolder |
Presenter.ViewHolder
|
item |
Object
|
Presenter.ViewHolder onCreateViewHolder (ViewGroup parent)
Creates a new View
.
Parameters | |
---|---|
parent |
ViewGroup
|
Returns | |
---|---|
Presenter.ViewHolder |
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
|
void setNullItemVisibilityGone (boolean nullItemVisibilityGone)
Optionally sets the view visibility to GONE
when bound to null.
Parameters | |
---|---|
nullItemVisibilityGone |
boolean
|
void setSelectLevel (RowHeaderPresenter.ViewHolder holder, float selectLevel)
Sets the select level.
Parameters | |
---|---|
holder |
RowHeaderPresenter.ViewHolder
|
selectLevel |
float
|
float getFontDescent (TextView textView, Paint fontMeasurePaint)
Parameters | |
---|---|
textView |
TextView
|
fontMeasurePaint |
Paint
|
Returns | |
---|---|
float |
void onSelectLevelChanged (RowHeaderPresenter.ViewHolder holder)
Called when the select level changes. The default implementation sets the alpha on the view.
Parameters | |
---|---|
holder |
RowHeaderPresenter.ViewHolder
|