PresenterSwitcher
abstract class PresenterSwitcher
kotlin.Any | |
↳ | androidx.leanback.widget.PresenterSwitcher |
An abstract helper class that switches a view in its parent view using a PresenterSelector
. A subclass should implement insertView(View)
to define how to add the view in parent, and may optionally override onViewSelected(View)
.
Summary
Public constructors | |
---|---|
<init>() An abstract helper class that switches a view in its parent view using a |
Public methods | |
---|---|
open Unit |
clear() Destroys created views. |
ViewGroup! |
Returns the parent. |
open Unit |
init(parent: ViewGroup!, presenterSelector: PresenterSelector!) Initializes the switcher with a parent view to insert view into and a |
open Unit |
Selects a view based on the given object and shows that view. |
open Unit |
unselect() Hides the view. |
Protected methods | |
---|---|
abstract Unit |
insertView(view: View!) |
open Unit |
onViewSelected(view: View!) Called when a view is bound to the object of |
open Unit |
Public constructors
<init>
PresenterSwitcher()
An abstract helper class that switches a view in its parent view using a PresenterSelector
. A subclass should implement insertView(View)
to define how to add the view in parent, and may optionally override onViewSelected(View)
.
Public methods
init
open fun init(
parent: ViewGroup!,
presenterSelector: PresenterSelector!
): Unit
Initializes the switcher with a parent view to insert view into and a PresenterSelector
for choosing a Presenter
for a given object. This will destroy any existing views.
select
open fun select(object: Any!): Unit
Selects a view based on the given object and shows that view.
Protected methods
onViewSelected
protected open fun onViewSelected(view: View!): Unit
Called when a view is bound to the object of select(Object)
.