belongs to Maven artifact androidx.leanback:leanback:1.0.0-alpha1

ClassPresenterSelector

public final class ClassPresenterSelector
extends PresenterSelector

java.lang.Object
   ↳ androidx.leanback.widget.PresenterSelector
     ↳ androidx.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

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[]