Most visited

Recently visited

DetailsOverviewLogoPresenter

public class DetailsOverviewLogoPresenter
extends Presenter

java.lang.Object
   ↳ android.support.v17.leanback.widget.Presenter
     ↳ android.support.v17.leanback.widget.DetailsOverviewLogoPresenter


演示者负责创建ImageView并将其绑定到DetailsOverviewRow。 默认实现使用getImageDrawable()并绑定到ImageView

默认实现假定上的ImageView没有scaleType并使用固有宽度和高度getImageDrawable()初始化的ImageView布局PARAMS。 要指定一个固定大小和/或指定一个scapeType,子类应该在onCreateView(ViewGroup)更改ImageView的布局参数和onCreateView(ViewGroup)

子类可能会覆盖并拥有自己的图像视图。 子类也可以从URL下载图像,而不是使用getImageDrawable() 每当isBoundToImage(ViewHolder, DetailsOverviewRow)转为真时,调用notifyOnBindLogo(FullWidthDetailsOverviewRowPresenter.ViewHolder)是子类的责任,以便可以开始活动转换。

Summary

Nested classes

class DetailsOverviewLogoPresenter.ViewHolder

DetailsOverviewRow的Logo视图的ViewHolder。

Public constructors

DetailsOverviewLogoPresenter()

Public methods

boolean isBoundToImage(DetailsOverviewLogoPresenter.ViewHolder viewHolder, DetailsOverviewRow row)

如果徽标视图绑定到图像,则返回true。

void onBindViewHolder(Presenter.ViewHolder viewHolder, Object item)

绑定标识可查看DetailsOverviewRow并调用notifyOnBindLogo()。

View onCreateView(ViewGroup parent)

为Logo创建视图,默认实现从 lb_fullwidth_details_overview_logo加载。

Presenter.ViewHolder onCreateViewHolder(ViewGroup parent)

创建一个新的 View

void onUnbindViewHolder(Presenter.ViewHolder viewHolder)

从项目中 View绑定 View

void setContext(DetailsOverviewLogoPresenter.ViewHolder viewHolder, FullWidthDetailsOverviewRowPresenter.ViewHolder parentViewHolder, FullWidthDetailsOverviewRowPresenter parentPresenter)

FullWidthDetailsOverviewRowPresenter调用以设置承载徽标的FullWidthDetailsOverviewRowPresenter和FullWidthDetailsOverviewRowPresenter.ViewHolder。

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

DetailsOverviewLogoPresenter

DetailsOverviewLogoPresenter ()

Public methods

isBoundToImage

boolean isBoundToImage (DetailsOverviewLogoPresenter.ViewHolder viewHolder, 
                DetailsOverviewRow row)

如果徽标视图绑定到图像,则返回true。 子类可能会覆盖。 getImageDrawable()不为空时,默认实现返回true。 如果notifyOnBindLogo(FullWidthDetailsOverviewRowPresenter.ViewHolder)子类管理自己的图像可绘制,则应该重写此函数以正确报告状态,并在图像视图绑定到drawable时调用notifyOnBindLogo(FullWidthDetailsOverviewRowPresenter.ViewHolder)

Parameters
viewHolder DetailsOverviewLogoPresenter.ViewHolder
row DetailsOverviewRow
Returns
boolean

onBindViewHolder

void onBindViewHolder (Presenter.ViewHolder viewHolder, 
                Object item)

绑定标识可查看DetailsOverviewRow并调用notifyOnBindLogo()。 如果isSizeFromDrawableIntrinsic()为true,则默认实现假定Logo视图是一个ImageView并将布局大小更改为ImageDrawable的固有大小。

Parameters
viewHolder Presenter.ViewHolder: ViewHolder to bind.
item Object: DetailsOverviewRow object to bind.

onCreateView

View onCreateView (ViewGroup parent)

为Logo创建视图,默认实现从lb_fullwidth_details_overview_logo加载。 子类可以重写此方法以使用固定的布局大小并更改ImageView scaleType。 如果布局参数对于宽度和大小均为WRAP_CONTENT,则ViewHolder将使用onBindViewHolder(Presenter.ViewHolder, Object)中Drawable的固有尺寸。

Parameters
parent ViewGroup: Parent view.
Returns
View View created for the logo.

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

setContext

void setContext (DetailsOverviewLogoPresenter.ViewHolder viewHolder, 
                FullWidthDetailsOverviewRowPresenter.ViewHolder parentViewHolder, 
                FullWidthDetailsOverviewRowPresenter parentPresenter)

FullWidthDetailsOverviewRowPresenter调用以设置承载徽标的FullWidthDetailsOverviewRowPresenter和FullWidthDetailsOverviewRowPresenter.ViewHolder。

Hooray!