PanelContainerControllerAdapter

interface PanelContainerControllerAdapter<V : ViewGroup, CD, VM : PanelSubContainerViewModel<SD>, SD>

Adapts PanelContainerElements to a PanelContainerView.

Responsible for:

  • Creation of PanelContainerElements.

  • Adding and removing of panel container elements in the view hierarchy.

  • Execution of panel container element animations.

  • Associating the panel sub-container data of type SD to the view models of each panel sub-container.

  • Creating PanelFragmentAdapters per panel sub-container. PanelFragmentAdapters define the logic for attaching Panels to panel fragment containers. A panel sub-container contains one or more panel fragment containers.

  • Keeping track of the active panel sub-container view models and restore the state of the panel sub-containers based on this when the view is restored.

Parameters

V

The panel container ViewGroup type that implements the PanelContainerView interface.

CD

The type of the panel container data. The panel container data is the input data that is visualized by the panel container.

VM

The panel sub-container view model type.

SD

The type of the panel sub-container data. The data is derived from the panel container data of type CD.

Functions

Link copied to clipboard
abstract fun initialize(adapterContext: PanelContainerControllerAdapterContext<V>, restorePanelContainerViewModel: PanelContainerViewModel<CD, VM, SD>?)

Initializes the adapter. This must be called before update or onStop is called.

Link copied to clipboard
abstract fun onStop(): PanelContainerViewModel<CD, VM, SD>

Called when the system UI is stopped.

Link copied to clipboard
abstract fun update(panelContainerData: CD?)

Called whenever the panel container data for the PanelContainerView has been changed.

Inheritors

Link copied to clipboard