Home
vector / com.haroldadmin.vector
Package com.haroldadmin.vector¶
Types¶
| Name | Summary |
|---|---|
| ActivityViewModelOwner | class ActivityViewModelOwner :ViewModelOwnerA ViewModelOwner wrapping an Activity |
| FragmentViewModelOwner | class FragmentViewModelOwner :ViewModelOwnerA ViewModelOwner which wraps the parent fragment of a ViewModel |
| SavedStateVectorViewModel | abstract class SavedStateVectorViewModel<S :VectorState> :VectorViewModel<S>A Subclass of VectorViewModel that has access to a SavedStateHandle to easily persist state properties in case of process death |
| Vector | object VectorSingleton object to configure the library |
| VectorFragment | abstract class VectorFragment :FragmentA Fragment which has a convenient fragmentScope property to easily launch coroutines in it. |
| vectorLazy | class vectorLazy<out T> :Lazy<T>A lazy delegate class, which takes in an initializer to initialize its underlying property. Implements the double-checked locking algorithm. |
| VectorState | interface VectorStateA state object contains all the necessary information to render the view. |
| VectorViewModel | abstract class VectorViewModel<S :VectorState> :ViewModelThe Base ViewModel class your ViewModel should inherit from |
| VectorViewModelFactory | interface VectorViewModelFactory<VM :VectorViewModel<S>, S :VectorState>A Factory meant to be implemented using the Companion object of a VectorViewModel to provide ways to create the initial state, as well as the creation of the ViewModel itself. |
| VectorViewModelProvider | object VectorViewModelProviderA class which is responsible for creating ViewModel instances. |
| ViewModelOwner | sealed class ViewModelOwnerViewModelOwner wraps the owner of a VectorViewModel. |
Extensions for External Classes¶
| Name | Summary |
|---|---|
| androidx.activity.ComponentActivity | |
| androidx.fragment.app.Fragment |
Functions¶
| Name | Summary |
|---|---|
| context | funViewModelOwner.context():ContextGet access to Context from a ViewModelOwner. |
| withState | fun <S :VectorState> withState(viewModel:VectorViewModel<S>, block: (S) ->Unit):UnitA convenience function to access current state and execute an action on it. |