Package com.tomtom.ivi.platform.frontend.api.common.frontend.viewmodels

Types

Link copied to clipboard
class CompositeViewModelFactory(factories: List<ViewModelProvider.Factory>) : ViewModelProvider.Factory

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
open class FixedConstructorFactory(parameters: Any) : ViewModelProvider.Factory

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>(val panel: P) : LifecycleViewModel

A ViewModel that references the panel that hosts this ViewModel.

Link copied to clipboard
class ViewModelConstructorNotFoundException(    viewModelClass: Class<*>,     args: Array<out Any>,     throwable: 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 ViewModelDelegate<VM : ViewModel>(key: String) : ReadOnlyProperty<Any?, VM>

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

Link copied to clipboard
class ViewModelInstantiationException(viewModelClass: Class<*>, throwable: Throwable) : RuntimeException

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
class ViewModelPropertyDelegate<P : Any>(key: String) : ReadOnlyProperty<Any?, P>

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
object ViewModelProviderUtil

Object containing methods to simplify the interaction with the ViewModelProvider.