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提供了默认显示HeaderItem使用RowHeaderView 如果子类创建它自己的视图,那么子类也必须覆盖onSelectLevelChanged(ViewHolder)

Summary

Nested classes

class RowHeaderPresenter.ViewHolder

RowHeaderPresenter的ViewHolder。

Public constructors

RowHeaderPresenter()

Public methods

int getSpaceUnderBaseline(RowHeaderPresenter.ViewHolder holder)

返回文本视图基线以下的空间(以像素为单位)(如果存在的话); 否则,返回0。

boolean isNullItemVisibilityGone()

如果视图可见性绑定到null时设置为 GONE ,则返回true。

void onBindViewHolder(Presenter.ViewHolder viewHolder, Object item)

View绑定到一个项目。

Presenter.ViewHolder onCreateViewHolder(ViewGroup parent)

创建一个新的 View

void onUnbindViewHolder(Presenter.ViewHolder viewHolder)

从项目中 View绑定 View

void setNullItemVisibilityGone(boolean nullItemVisibilityGone)

绑定到null时,可选地将视图可见性设置为 GONE

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

设置选择级别。

Protected methods

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

当选择级别改变时调用。

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)

返回文本视图基线以下的空间(以像素为单位)(如果存在的话); 否则,返回0。

Parameters
holder RowHeaderPresenter.ViewHolder
Returns
int

isNullItemVisibilityGone

boolean isNullItemVisibilityGone ()

如果视图可见性绑定到null时设置为 GONE ,则返回true。

Returns
boolean

onBindViewHolder

void onBindViewHolder (Presenter.ViewHolder viewHolder, 
                Object item)

View绑定到一个项目。

Parameters
viewHolder Presenter.ViewHolder
item Object

onCreateViewHolder

Presenter.ViewHolder onCreateViewHolder (ViewGroup parent)

创建一个新的 View

Parameters
parent ViewGroup
Returns
Presenter.ViewHolder

onUnbindViewHolder

void onUnbindViewHolder (Presenter.ViewHolder viewHolder)

从项目中View绑定View 任何昂贵的参考资料可能会在此处发布,并且任何未绑定到每个项目的字段都应在此处清除。

Parameters
viewHolder Presenter.ViewHolder

setNullItemVisibilityGone

void setNullItemVisibilityGone (boolean nullItemVisibilityGone)

当绑定为null时,可选地将视图可见性设置为 GONE

Parameters
nullItemVisibilityGone boolean

setSelectLevel

void setSelectLevel (RowHeaderPresenter.ViewHolder holder, 
                float selectLevel)

设置选择级别。

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)

当选择级别改变时调用。 默认实现在视图上设置alpha。

Parameters
holder RowHeaderPresenter.ViewHolder

Hooray!