ViewModelInstanceSource

sealed interface ViewModelInstanceSource

The second half of a source for a ViewModelInstance. This represents the specific instance of the view model. This can be either:

  • Blank for an instance with default initialized properties,

  • Default for the default instance, or

  • Named for a specific named instance.

The Reference option is used to refer to a child instance, given an existing instance, at a slash delimited path.

Inheritors

Types

Link copied to clipboard

Create a new view model instance with default value initialized properties, e.g. 0 for integers, empty strings, etc.

Link copied to clipboard

Create a new view model instance with properties initialized to the values of the instance labelled "Default" in the Rive file.

Link copied to clipboard
data class Named(val vmSource: ViewModelSource, val instanceName: String) : ViewModelInstanceSource

Create a new view model instance with properties initialized to the values of the instance with the given name.

Link copied to clipboard
data class Reference(val parentInstance: ViewModelInstance, val path: String) : ViewModelInstanceSource

Create a reference to an existing child view model instance.

Link copied to clipboard
data class ReferenceListItem(val parentInstance: ViewModelInstance, val pathToList: String, val index: Int) : ViewModelInstanceSource

Create a reference to an existing child view model instance within a list at a given index.