PanelSubContainerManager

interface PanelSubContainerManager<P : Any, S : PanelSubContainerState, H : PanelSubContainerHolder>

An interface to manage a sub-container views. New sub-container view or views wrapped into PanelSubContainerHolder.

PanelContainerController is responsible for animating creation and removal of sub-container views. A manager can indicate the removal of a sub-container and its animation should not be performed by returning false from canBeRemoved. For example, a manager may need to postpone a removal for a sub-container that is being dismissed.

Parameters

P

The type of panel data that populates the container view. It can be a single panel, a collection of panels or any other panel-related type.

S

The type of a sub-container state that is used to restore a sub-container after configuration change.

H

The type of a sub-container holder that is managed.

Functions

Link copied to clipboard
abstract fun addSubContainer(    parent: ViewGroup,     lifecycleOwner: LifecycleOwner,     panelData: P? = null,     subContainerState: S? = null): H

Creates a new PanelSubContainerHolder of type H, inflating or creating views for a sub-container. Views are attached it to parent, using lifecycleOwner for data binding. panelData and subContainerState is optional information.

Link copied to clipboard
abstract fun canBeRemoved(subContainerHolder: H): Boolean

Whether views in subContainerHolder can be removed. It should be checked before calling removeSubContainer.

Link copied to clipboard
abstract fun removeSubContainer(subContainerHolder: H)

Removes subContainerHolder, destroying views for a sub-container.

Inheritors

Link copied to clipboard