createView

fun createView(context: Context, parent: ViewGroup, item: T, subLifecycleOwner: SubLifecycleOwner, addViewToParent: (ViewGroup, View) -> Unit = { parentView, view -> parentView.addView(view) }): View

Creates a bound view for the item using the provided subLifecycleOwner, the view needs to be added to the parent using the addViewToParent function. The subLifecycleOwner should be derived from the lifecycleOwner and therefore guarantees that its lifecycle state is at most the lifecycle state of the lifecycleOwner.

Throws

when the view is not added to the parent.