Home
vector / com.haroldadmin.vector
Package com.haroldadmin.vector¶
Types¶
Name | Summary |
---|---|
ActivityViewModelOwner | class ActivityViewModelOwner : ViewModelOwner A ViewModelOwner wrapping an Activity |
FragmentViewModelOwner | class FragmentViewModelOwner : ViewModelOwner A 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 Vector Singleton object to configure the library |
VectorFragment | abstract class VectorFragment : Fragment A 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 VectorState A state object contains all the necessary information to render the view. |
VectorViewModel | abstract class VectorViewModel<S : VectorState > : ViewModel The 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 VectorViewModelProvider A class which is responsible for creating ViewModel instances. |
ViewModelOwner | sealed class ViewModelOwner ViewModelOwner wraps the owner of a VectorViewModel. |
Extensions for External Classes¶
Name | Summary |
---|---|
androidx.activity.ComponentActivity | |
androidx.fragment.app.Fragment |
Functions¶
Name | Summary |
---|---|
context | fun ViewModelOwner .context(): Context Get access to Context from a ViewModelOwner. |
withState | fun <S : VectorState > withState(viewModel: VectorViewModel < S >, block: ( S ) -> Unit ): Unit A convenience function to access current state and execute an action on it. |