-
public class ViewModelInstance.Companion
-
-
Field Summary
Fields Modifier and Type Field Description public final static ViewModelInstance.CompanionINSTANCE
-
Method Summary
Modifier and Type Method Description final ViewModelInstancecreate(RiveFile file, ViewModelInstanceSource source)Creates a new ViewModelInstance and suspends until its Rive worker confirms creation. final ViewModelInstancefromFile(RiveFile file, ViewModelInstanceSource source)Creates a new ViewModelInstance. -
-
Method Detail
-
create
final ViewModelInstance create(RiveFile file, ViewModelInstanceSource source)
Creates a new ViewModelInstance and suspends until its Rive worker confirms creation.
This is the replacement for fromFile. Its temporary name avoids a source-incompatible overload; it will be renamed to
fromFilein 12.0 when the unconfirmed API is removed.⚠️ The lifetime of a successfully created view model instance is managed by the caller. Make sure to call close when you are done with it to release its resources.
- Parameters:
file- The RiveFile to create the view model instance from.source- The source of the view model instance.
-
fromFile
@Deprecated(message = Use create. This unconfirmed implementation will be removed in 12.0, when create will be renamed to fromFile as a suspending API.) final ViewModelInstance fromFile(RiveFile file, ViewModelInstanceSource source)
Creates a new ViewModelInstance.
⚠️ The lifetime of the returned view model instance is managed by the caller. Make sure to call close when you are done with the instance to release its resources.
- Parameters:
file- The RiveFile to create the view model instance from.source- The source of the view model instance.
-
-
-
-