Rive
The main composable for rendering a Rive file's artboard and state machine.
Internally, Rive uses a TextureView to create and manage a android.view.Surface for rendering.
The composable will advance the state machine and draw the artboard on every frame while the Lifecycle is in the Lifecycle.State.RESUMED state. It will also handle pointer input events to influence the state machine, such as pointer down, move, and up events.
A Rive composable can enter a settled state, where it stops advancing the state machine. It will be restarted when influenced by other events, such as pointer input or view model instance changes.
Parameters
The RiveFile that created the artboard and state machine.
The Modifier to apply to the composable.
Whether the state machine should advance. When true (default), the state machine will advance on each frame. When false, the advancement loop will not activate.
The Artboard to render. If null, the default artboard will be used.
The StateMachine to use. If null, the default state machine will be created.
The ViewModelInstance to bind to the state machine. If null, no view model instance will be bound.
The Fit to use for the artboard. Defaults to Fit.Contain.
The color to clear the surface with before drawing. Defaults to transparent.
Controls how pointer events are handled and consumed by Rive. See RivePointerInputMode. Default is RivePointerInputMode.Consume.
Controls how often Rive advances and draws while playing is true. Defaults to RiveFrameRate.Unbounded, which renders on every platform frame callback. On supported Android versions, capped rates are also used as an advisory view frame-rate hint.
Optional callback that is invoked when the first bitmap frame is available. The callback provides a function to get the current Bitmap from the underlying TextureView. This can be used for snapshot testing or storing rendered output. The bitmap getter is only valid while the surface is active.