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: Fragment The parent fragment wrapped in this class |
Functions¶
Name | Summary |
---|---|
activity | fun <A : FragmentActivity > activity(): A Get 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(): F Get a type-casted version of the parent fragment wrapped in this class |
Extension Functions¶
Name | Summary |
---|---|
context | fun ViewModelOwner .context(): Context Get access to Context from a ViewModelOwner. |