commons/ui / com.vmadalin.commons.ui.base / BaseFragment

BaseFragment

abstract class BaseFragment<B : ViewDataBinding, M : ViewModel> : Fragment

Base fragment to standardize and simplify initialization for this component.

Parameters

layoutId - Layout resource reference identifier.

See Also

Fragment

Constructors

<init>

Base fragment to standardize and simplify initialization for this component.

BaseFragment(layoutId: Int)

Properties

viewBinding

lateinit var viewBinding: B

viewModel

lateinit var viewModel: M

Functions

onAttach

Called when a fragment is first attached to its context.

open fun onAttach(context: Context): Unit

onCreateView

Called to have the fragment instantiate its user interface view.

open fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View?

onInitDataBinding

abstract fun onInitDataBinding(): Unit

onInitDependencyInjection

abstract fun onInitDependencyInjection(): Unit

onViewCreated

Called to have the fragment instantiate its user interface view.

open fun onViewCreated(view: View, savedInstanceState: Bundle?): Unit

requireCompatActivity

Return the AppCompatActivity this fragment is currently associated with.

fun requireCompatActivity(): AppCompatActivity