public final class ClassPresenterSelector
extends PresenterSelector
java.lang.Object | ||
↳ | android.support.v17.leanback.widget.PresenterSelector | |
↳ | android.support.v17.leanback.widget.ClassPresenterSelector |
Presenter
根据项目的Java类选择 Presenter
。
Public constructors |
|
---|---|
ClassPresenterSelector() |
Public methods |
|
---|---|
ClassPresenterSelector |
addClassPresenter(Class<?> cls, Presenter presenter) 设置要用于给定类的演示者。 |
ClassPresenterSelector |
addClassPresenterSelector(Class<?> cls, PresenterSelector presenterSelector) 设置用于给定类的演示者选择器。 |
Presenter |
getPresenter(Object item) 返回给定项目的演示者。 |
Presenter[] |
getPresenters() 返回所有可能演示者的数组。 |
Inherited methods |
|
---|---|
From class android.support.v17.leanback.widget.PresenterSelector
|
|
From class java.lang.Object
|
ClassPresenterSelector ()
ClassPresenterSelector addClassPresenter (Class<?> cls, Presenter presenter)
设置要用于给定类的演示者。
Parameters | |
---|---|
cls |
Class : The data model class to be rendered. |
presenter |
Presenter : The presenter that renders the objects of the given class. |
Returns | |
---|---|
ClassPresenterSelector |
This ClassPresenterSelector object. |
ClassPresenterSelector addClassPresenterSelector (Class<?> cls, PresenterSelector presenterSelector)
设置用于给定类的演示者选择器。
Parameters | |
---|---|
cls |
Class : The data model class to be rendered. |
presenterSelector |
PresenterSelector : The presenter selector that finds the right presenter for a given class. |
Returns | |
---|---|
ClassPresenterSelector |
This ClassPresenterSelector object. |
Presenter getPresenter (Object item)
返回给定项目的演示者。
Parameters | |
---|---|
item |
Object
|
Returns | |
---|---|
Presenter |