vector / com.haroldadmin.vector / FragmentViewModelOwner
FragmentViewModelOwner¶
class FragmentViewModelOwner :ViewModelOwner
A ViewModelOwner which wraps the parent fragment of a ViewModel
Constructors¶
| Name | Summary |
|---|---|
| <init> | FragmentViewModelOwner(fragment:Fragment, args:Bundle? = fragment.arguments)Creates a ViewModelOwner wrapping the given Fragment |
Properties¶
| Name | Summary |
|---|---|
| fragment | val fragment:FragmentThe parent fragment wrapped in this class |
Functions¶
| Name | Summary |
|---|---|
| activity | fun <A :FragmentActivity> activity():AGet a type-casted version of the parent activity of the wrapped fragment |
| args | fun args():Bundle?Get the arguments bundle wrapped in this class |
| fragment | fun <F :Fragment> fragment():FGet a type-casted version of the parent fragment wrapped in this class |
Extension Functions¶
| Name | Summary |
|---|---|
| context | funViewModelOwner.context():ContextGet access to Context from a ViewModelOwner. |