VastVbVmFragment
VastVbVmFragment.
// Use in kotlin
class SampleVbVmFragment : VastVbVmFragment<FragmentSampleVbVmBinding, SampleSharedVM>() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
// Something to do
}
}
Content copied to clipboard
Parameters
VB
ViewBinding of the fragment layout.
VM
ViewModel of the fragment.
Functions
Link copied to clipboard
Clear the ViewBinding. By default, it will throw a IllegalStateException.
Link copied to clipboard
Get the ViewBinding. By default, it will throw a IllegalStateException.
Link copied to clipboard
Get the ViewModel. By default, it will throw a IllegalStateException.
Link copied to clipboard
open override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View
Link copied to clipboard
Link copied to clipboard
When setVmBySelf is true, it means that ViewModelStoreOwner is Fragment itself. When you want ViewModelStoreOwner to be the androidx.fragment.app.FragmentActivity this fragment is currently associated with, set setVmBySelf to false.