6월 3일의 ⁠#Android11: 베타 버전 출시 행사에 참여하세요.

ClassPresenterSelector

class ClassPresenterSelector : PresenterSelector
kotlin.Any
   ↳ androidx.leanback.widget.PresenterSelector
   ↳ androidx.leanback.widget.ClassPresenterSelector

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

Summary

Public constructors

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

Public methods

ClassPresenterSelector!
addClassPresenter(cls: Class<*>!, presenter: Presenter!)

Sets a presenter to be used for the given class.

ClassPresenterSelector!
addClassPresenterSelector(cls: Class<*>!, presenterSelector: PresenterSelector!)

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

Presenter!
getPresenter(item: Any!)

Array<Presenter!>!

Public constructors

<init>

ClassPresenterSelector()

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

Public methods

addClassPresenter

fun addClassPresenter(
    cls: Class<*>!,
    presenter: Presenter!
): ClassPresenterSelector!

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.
Return
ClassPresenterSelector! This ClassPresenterSelector object.

addClassPresenterSelector

fun addClassPresenterSelector(
    cls: Class<*>!,
    presenterSelector: PresenterSelector!
): ClassPresenterSelector!

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.
Return
ClassPresenterSelector! This ClassPresenterSelector object.

getPresenter

fun getPresenter(item: Any!): Presenter!

getPresenters

fun getPresenters(): Array<Presenter!>!