Most visited

Recently visited

ClassPresenterSelector

public final class ClassPresenterSelector
extends PresenterSelector

java.lang.Object
   ↳ android.support.v17.leanback.widget.PresenterSelector
     ↳ android.support.v17.leanback.widget.ClassPresenterSelector


A ClassPresenterSelector selects a Presenter based on the item's Java class.

Summary

Public constructors

ClassPresenterSelector()

Public methods

ClassPresenterSelector addClassPresenter(Class<?> cls, Presenter presenter)

Sets a presenter to be used for the given class.

ClassPresenterSelector addClassPresenterSelector(Class<?> cls, PresenterSelector presenterSelector)

Sets a presenter selector to be used for the given class.

Presenter getPresenter(Object item)

Returns a presenter for the given item.

Presenter[] getPresenters()

Returns an array of all possible presenters.

Inherited methods

From class android.support.v17.leanback.widget.PresenterSelector
From class java.lang.Object

Public constructors

ClassPresenterSelector

ClassPresenterSelector ()

Public methods

addClassPresenter

ClassPresenterSelector addClassPresenter (Class<?> cls, 
                Presenter presenter)

Sets a presenter to be used for the given class.

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.

addClassPresenterSelector

ClassPresenterSelector addClassPresenterSelector (Class<?> cls, 
                PresenterSelector presenterSelector)

Sets a presenter selector to be used for the given class.

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.

getPresenter

Presenter getPresenter (Object item)

Returns a presenter for the given item.

Parameters
item Object
Returns
Presenter

getPresenters

Presenter[] getPresenters ()

Returns an array of all possible presenters. The returned array should not be modified.

Returns
Presenter[]

Hooray!