Package-level declarations

Types

Link copied to clipboard
value class ArtboardHandle(val handle: Long)

A handle to an artboard instance on the CommandServer. Created with CommandQueue.createDefaultArtboard or CommandQueue.createArtboardByName and deleted with CommandQueue.deleteArtboard.

Link copied to clipboard

Provides control over the Rive audio engine (powered by https://miniaud.io/).

Link copied to clipboard
value class AudioHandle(val handle: Long)

A handle to a AudioSource on the CommandServer. Created with CommandQueue.decodeAudio and deleted with CommandQueue.deleteAudio.

Link copied to clipboard

An AutoCloseable that can report whether it has been closed.

Link copied to clipboard

An owned Android Surface paired with the Android resource that backs it. Used only to create a RiveSurface with CommandQueue.createRiveSurface, which takes ownership, while also encoding resource cleanup.

Link copied to clipboard
class CloseOnce(label: String, onClose: () -> Unit) : CheckableAutoCloseable

Utility to make CheckableAutoCloseable idempotent.

Link copied to clipboard

A CommandQueue is the worker that runs Rive in a thread. It holds all of the state, including assets (images, audio, and fonts), Rive files, artboards, state machines, and view model instances.

Link copied to clipboard

Abstraction of calls to the native command queue.

Link copied to clipboard
data class DefaultViewModelInfo(val viewModelName: String, val instanceName: String)
Link copied to clipboard
value class DrawKey(val handle: Long)

A key used to uniquely identify a draw operation in the CommandQueue. This is useful when the same CommandQueue issues multiple draw calls. If the same key is used before the render loop flushes the queue, the previous draw call will be replaced with the new one.

Link copied to clipboard
object EGLError

Utility to convert EGL error codes to human-readable strings.

Link copied to clipboard
value class FileHandle(val handle: Long)

A handle to a Rive file on the CommandServer. Created with CommandQueue.loadFile and deleted with CommandQueue.deleteFile.

Link copied to clipboard
value class FontHandle(val handle: Long)

A handle to a Font on the CommandServer. Created with CommandQueue.decodeFont and deleted with CommandQueue.deleteFont.

Link copied to clipboard
fun interface FrameTicker

A way of getting frame callbacks every vsync.

Link copied to clipboard
value class ImageHandle(val handle: Long)

A handle to a RenderImage on the CommandServer. Created with CommandQueue.decodeImage and deleted with CommandQueue.deleteImage.

Link copied to clipboard
Link copied to clipboard
data class Listeners(val fileListener: Long, val artboardListener: Long, val stateMachineListener: Long, val viewModelInstanceListener: Long, val imageListener: Long, val audioListener: Long, val fontListener: Long) : AutoCloseable

Holds the native pointers to the listeners used by the CommandQueue. Android uses only one listener of each type to simplify lifetime management. This is as opposed to a listener for each handle.

Link copied to clipboard
class RCPointer(cppPointer: Long, val label: String, onDispose: (Long) -> Unit) : RefCounted

A reference-counted pointer to a native C++ object.

Link copied to clipboard
interface RefCounted

An interface for reference-counted objects. Can be used with RCPointer by delegation.

Link copied to clipboard

Additional alias for the interior type RiveWorker.PropertyUpdate due to not being accessible from RiveWorker.

Link copied to clipboard

A backend agnostic collection of surface properties needed for rendering.

Link copied to clipboard

CommandQueue is named to match the underlying core C++ class, which reflects its algorithm: a queue of commands that are dispatched to a command server which receives them and operates on Rive files.

Link copied to clipboard
value class StateMachineHandle(val handle: Long)

A handle to a state machine instance on the CommandServer. Created with CommandQueue.createDefaultStateMachine or CommandQueue.createStateMachineByName and deleted with CommandQueue.deleteStateMachine.

Link copied to clipboard
class SurfaceTextureSurface(surfaceTexture: SurfaceTexture, val width: Int, val height: Int) : CloseableSurface
Link copied to clipboard
data class UniquePointer(cppPointer: Long, val label: String, onDispose: (Long) -> Unit) : CheckableAutoCloseable

A unique pointer to a native C++ object.

Link copied to clipboard
value class ViewModelInstanceHandle(val handle: Long)

A handle to a view model instance on the CommandServer. Created with CommandQueue.createViewModelInstance and deleted with CommandQueue.deleteViewModelInstance.

Properties

Link copied to clipboard

A FrameTicker that uses Choreographer to get frame callbacks.

Link copied to clipboard
Link copied to clipboard

A FrameTicker that uses withFrameNanos to get frame callbacks.

Functions

Link copied to clipboard
inline fun <T> traceSection(sectionName: String, block: () -> T): T

Runs block inside an Android trace section.

Link copied to clipboard
suspend fun <R> withFrameNanosChoreographer(onFrame: (Long) -> R): R

An API compatible version of withFrameNanos from Compose that uses Choreographer.