PresenterSwitcher

abstract class PresenterSwitcher

Known direct subclasses
HorizontalHoverCardSwitcher

A helper class for showing a hover card view below a HorizontalGridView.


An abstract helper class that switches a view in its parent view using a PresenterSelector. A subclass should implement insertView to define how to add the view in parent, and may optionally override onViewSelected.

Summary

Public constructors

Public functions

Unit

Destroys created views.

ViewGroup!

Returns the parent.

Unit
init(parent: ViewGroup!, presenterSelector: PresenterSelector!)

Initializes the switcher with a parent view to insert view into and a PresenterSelector for choosing a Presenter for a given object.

Unit
select(object: Any!)

Selects a view based on the given object and shows that view.

Unit

Hides the view.

Protected functions

abstract Unit
insertView(view: View!)
Unit

Called when a view is bound to the object of select.

Unit
showView(view: View!, visible: Boolean)

Public constructors

PresenterSwitcher

Added in 1.1.0
PresenterSwitcher()

Public functions

clear

Added in 1.1.0
fun clear(): Unit

Destroys created views.

getParentViewGroup

Added in 1.1.0
fun getParentViewGroup(): ViewGroup!

Returns the parent.

init

Added in 1.1.0
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

Added in 1.1.0
fun select(object: Any!): Unit

Selects a view based on the given object and shows that view.

unselect

Added in 1.1.0
fun unselect(): Unit

Hides the view.

Protected functions

insertView

Added in 1.1.0
protected abstract fun insertView(view: View!): Unit

onViewSelected

Added in 1.1.0
protected fun onViewSelected(view: View!): Unit

Called when a view is bound to the object of select.

showView

Added in 1.1.0
protected fun showView(view: View!, visible: Boolean): Unit