RecyclerPanelContainerControllerAdapter

@IviExperimental(reasons = [])
class RecyclerPanelContainerControllerAdapter<V : RecyclerView, CD, VM : PanelSubContainerViewModel<SD>, SD>(subContainerController: RecyclerSubContainerController<CD, VM, SD>, subContainerViewModelFactory: () -> VM, basicElementConfigurator: RecyclerBasicElementConfigurator<CD, SD>.() -> Unit, panelContainerElementAnimator: PanelContainerElementAnimator<VM, SD>) : BasePanelContainerControllerAdapter<V, CD, VM, SD>

A PanelContainerControllerAdapter for visualizing PanelContainerElements as part of a RecyclerView.

This PanelContainerControllerAdapter implementation fulfills the responsibilities of a PanelContainerControllerAdapter based on callbacks from the RecyclerView.Adapter.

The behavior of this adapter is controlled by the data provided back by the subContainerController, the basicElementConfigurator and the panelContainerElementAnimator.

The configured RecyclerBasicElementControllers through basicElementConfigurator can decorate the panel sub-container elements with basic elements. The RecyclerBasicElementController.decorateList methods of the basic element controllers are invoked in the order as configured by the basicElementConfigurator.

Parameters

V

The container RecyclerView type that implements the PanelContainer interface.

CD

The type of the panel container 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.

Constructors

Link copied to clipboard
fun <CD, VM : PanelSubContainerViewModel<SD>, SD> RecyclerPanelContainerControllerAdapter(subContainerController: RecyclerSubContainerController<CD, VM, SD>, subContainerViewModelFactory: () -> VM, basicElementConfigurator: RecyclerBasicElementConfigurator<CD, SD>.() -> Unit, panelContainerElementAnimator: PanelContainerElementAnimator<VM, SD>)

Properties

Link copied to clipboard
open override val subContainerViewModels: List<VM>

The panel sub-container view models.

Functions

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

Initializes adapterContext and invokes restore if restorePanelContainerViewModel is non-null.

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

Called when the system UI is stopped.

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

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