Package-level declarations

Contains view models of frontends.

Types

Link copied to clipboard

Composes multiple ViewModelProvider.Factorys. When create is called to create a view model it will try each factory in factories until it finds a factory which can create the requested view model.

Link copied to clipboard

Factory used to create view models upon re-creation of the fragment. The parameters should reflect the primary constructor of the ViewModel being recreated.

Link copied to clipboard
abstract class FrontendAndroidViewModel<P : AnyPanel>(panel: P, application: Application) : FrontendViewModel<P>

A combination of FrontendViewModel and AndroidViewModel. Should only be used when the Application instance is really required. This should be rare however, as ViewModels should not normally rely on a context. Instead, the layout should resolve raw information from the ViewModel using its own context.

Link copied to clipboard
abstract class FrontendViewModel<P : AnyPanel>(panel: P) : LifecycleViewModel, PanelProvider<P>

A ViewModel that references the panel that hosts this ViewModel.

Link copied to clipboard
class ViewModelConstructorNotFoundException(viewModelClass: Class<out ViewModel>, args: Array<out Any>, cause: Throwable) : RuntimeException

Thrown when an application tries to create an instance of ViewModel class, but the specified class does not have the required constructor.

Link copied to clipboard

Class to be used as a delegate to a ViewModel which can be stored and retrieved in a ViewModelStore.

Link copied to clipboard

Thrown when an application tries to create an instance of ViewModel class, but the specified class object cannot be instantiated. The instantiation can fail for a variety of reasons including but not limited to:

Link copied to clipboard

This can be used to store a property of a fragment in a ViewModelStore. The property will be encapsulated in a ViewModel and stored, so that it can be retrieved upon re-creation of a fragment.

Link copied to clipboard

This object contains functions that assist in the creation of a ViewModelProvider and retrieving view models from it. This is the preferred method of interacting with ViewModelProvider as it facilitates the mocking of view model creation during view comparison tests.