class BindingViewFactory<B : ViewDataBinding>(inflateFunction: (LayoutInflater) -> B, bindDataFunction: (B) -> Unit) : SystemUiHost.ViewFactory

A factory for a data-bound main view to be shown within the system UI which that takes care of common tasks around inflation and binding a lifecycle owner.

If the binding accepts a panelContainerContext property of type PanelContainerContext, a value will automatically be assigned to it. If the binding doesn't have such a property or has to bind additional data, bindDataFunction can be used to do so.



A function that will inflate a view given a layout inflater, a container view, and whether the view should be attached to the container upon inflation. Matches the signature of a generated data binding class's inflate.


A function that will be called after view inflation, and can be used to bind data to the view. Pending bindings left after this function is called will be immediately executed.


Link copied to clipboard
constructor(inflateFunction: (LayoutInflater) -> B, bindDataFunction: (B) -> Unit)


Link copied to clipboard
open override fun bindData(lifecycleOwner: LifecycleOwner, panelContainerContext: PanelContainerContext)

Binds a view that was previously inflated with inflate to its data, observed by the given LifecycleOwner. The provided panelContainerContext can be used for binding panels to PanelContainers.

Link copied to clipboard
open override fun inflate(inflater: LayoutInflater): View

Inflates the view using the given inflater. The view will should not be attached to the container, but will be attached by the system UI.