createSubContainer

abstract fun createSubContainer(panelContainer: ViewGroup, subContainerViewModel: VM, panelContainerViewModel: PanelContainerViewModel<CD, VM, SD>): StateDrivenSubContainerController.SubContainerCreationResult<VM, SD>

Creates a new panel sub-container. If getNewSubContainerData returned a non-empty collection, this method is called for each item in the collection.

Note: Use PanelSubContainerViewModel.mutableExtraState delegate for mutable PanelSubContainerViewModel properties if a property change should be considered a panelContainerViewModel update and getNewSubContainerData, getSubContainerDataUpdates and isSubContainerExitAllowed should be called again.

Return

The panel sub-container and a lambda that is invoked to create one or more PanelFragmentAdapters.

Parameters

panelContainer

The panel container.

subContainerViewModel

The panel sub-container view model.

panelContainerViewModel

The current view model state of the adapter.