ViewFactory
A helper class that takes care of common tasks for creating a view in an IviFragment, such as inflation, binding a lifecycle owner, IviFragmentId and ViewModel and extracting a root view.
If the binding accepts a viewModel
variable of the same type as VM, viewModel will automatically be assigned to it. If the bindings accepts an iviFragmentId
variable of the type IviFragmentId, iviFragmentId will automatically be assigned to it. If the binding has other or additional variables, bindDataFunction can be used to do so.
Parameters
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.
Functions
Binds a view that was previously inflated with inflate to its data, observed by the given lifecycleOwner.