VastVbFragment

abstract class VastVbFragment<VB : ViewBinding> : VastFragment

VastVbFragment.

// Use in kotlin
class SampleVbFragment : VastVbFragment<FragmentSampleVbBinding>() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
// Something to do
}
}

Parameters

VB

ViewBinding of the fragment layout.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
private var mBinding: VB?

Functions

Link copied to clipboard
protected open override fun clearBinding()

Clear the ViewBinding. By default, it will throw a IllegalStateException.

Link copied to clipboard
protected open override fun getBinding(): VB

Get the ViewBinding. 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
open override fun onDestroyView()
Link copied to clipboard
protected open override fun setVmBySelf(): Boolean

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.