github rive-app/rive-android 11.17.0

one hour ago

Features

Deferred file decoding

Files decode eagerly by default. This release adds deferDecoding = true to RiveFile.load and rememberRiveFile, allowing eligible artboards, including their state machines, to decode when first needed. Animation keyframe data and view model instance values can also decode on demand. The default artboard and its state machine structures still decode during loading, but creating a state machine instance does not eagerly decode all of its animations. This can reduce initial loading work for files with substantial unused content, at the cost of retaining encoded data and moving some work to first use. (Change, Change, Change)

In Compose, once a file has been loaded eagerly, it is retained regardless of later changes to deferDecoding, preserving the work already done. Switching a deferred file to eager decoding reloads it. Changing the source or worker starts a new load using the current setting.

Blob data binding

This release adds blob data binding for passing large binary data, such as 3D models or other serialized formats, to scripts. The script determines how to interpret the data. Create a blob with BlobAsset.fromBytes, or use rememberBlob in Compose, then assign it with ViewModelInstance.setBlob(path, blob). Passing null clears the property. Creation copies the supplied bytes, and an assigned property retains the blob after the caller closes its asset handle. (Change)

Expanded experimental keyboard focus

Keyboard focus now supports arrow-key navigation in both Rive and RiveCanvasSession. Tab, Shift+Tab, and unmodified arrow keys first reach the focused Rive element. If unhandled, they move focus, continuing into the surrounding Android UI at Rive's boundaries. Other keys also reach focused Rive elements with keyboard listeners. Text and IME input integration is forthcoming. (Change, Change)

Focus remains experimental and off by default. Opt into ExperimentalRiveFocus and use focus = RiveFocusMode.Automatic or RiveFocusMode.On. A custom View hosting RiveCanvasSession must also apply the session's focusability and forward focus changes and key events through its focus integration methods.

Artboard dimensions

Artboard.getSize() returns the current width and height in artboard coordinates through a suspending call. It reflects resizing and restoration of the original artboard size, allowing Android code to query the dimensions actually in use. (Change)

Optional default view models

RiveFile.getDefaultViewModelInfoOrNull returns null when an artboard has no default view model, without treating that absence as an error. This makes it possible to support files with and without default data binding through the same loading path. (Change)

The throwing getDefaultViewModelInfo API is deprecated. The OrNull name is temporary to avoid a clash and is intended to replace the deprecated name in 12.0.

Language-aware text

Text and individual text runs can carry a language configured in the Rive Editor. The runtime uses it for language-specific glyph shaping and font fallback, including selecting appropriate CJK fonts on Android. Text without an explicit language uses the device language, and runs inherit their text's language. Deferred artboards preserve these settings too. (Change, Change)

Custom FontFallbackStrategy implementations can override getFont(weight, languages) to choose fonts by language. Existing implementations of getFont(weight) remain compatible.

Text decorations

The runtime now supports underline and strikethrough styles with their own paints, thickness, and offsets, including animation and data binding. Authoring is not enabled by default in the production or early-access Editor at the time of this release. (Change)

Justified text

This release adds playback support for justified text alignment. As with text decorations, authoring is not enabled by default in the production or early-access Editor at the time of this release. (Change)

Ink-based vertical text trimming

Text can trim its top and bottom independently to the actual glyph outlines on its first and last lines, rather than the font's general metrics. This includes combining marks. The calculation excludes strokes and text modifiers, and fixed-size text retains its configured box. (Change)

Layer masking across rendering modes

Layer masks now composite through GPU Canvas, extending support to atomics and MSAA rendering modes. Enable GPU Canvas with rememberDeferredRiveWorker or RiveWorker(enableGPUCanvas = true), under ExperimentalDeferredRendering. Without the required GPU Canvas support, content draws without its layer mask. (Change)

GPU Canvas shaders on OpenGL

GPU Canvas shaders that read multisampled textures can now run on OpenGL using a resolved copy. Every sample index reads that same resolved value, and textureNumSamples reports 1. This is a compatibility path, not access to distinct samples, so features().multisampledTextureRead remains false. (Change)

Scripting improvements

These changes apply to Luau scripts running in the Android runtime:

  • Node references and traversal: NodeRef inputs reference a node selected in the Rive Editor. Scripts can also inspect their own artboard through context:artboard() and their own node through context:node(), including node relationships and transforms. Reading these properties lets supported scripted components update when their dependencies change. (Change, Change)
  • Node bounds: NodeData:bounds() and worldBounds() return a node's local and world-space bounds. (Change)
  • Artboards from decoded files: RiveFile:artboard(name?) creates an owned root artboard from a file decoded by the script. The script can advance it, draw it, and forward input, with the decoded file's own main and global view model instances. See the limitations below. (Change)
  • Images from pixels: Image.fromPixels creates an image from a premultiplied RGBA8 buffer. The runtime copies the pixels, so the script can reuse its buffer afterward. This is supported through the current API's rendering factories, but not through the Legacy API. (Change)
  • Text drawing and styles: Text:drawLines(renderer, first, last, paint?) draws a selected range of lines using 1-based, inclusive indices. Script text-run styles also gain highlight, underline, and strikethrough paints. (Change)
  • Listener event control: A listener action's event:hit() now blocks pointer targets drawn below it, while event:hit(true) keeps the event translucent. Capture key listeners can also call hit() to stop a key before it reaches the focused target. Pointer blocking below a target is separate from the inward Stop Propagation behavior described below. (Change, Change)

Fixes

  • Deadlocks in custom font fallback: A fallback callback that registered a font or changed the fallback strategy could deadlock because it ran while the fallback mutex was held. Callbacks now run outside that lock. See the concurrency requirement under Behavior changes. (Fix)
  • Incorrect fallback glyphs and weights: Fallback now handles whole glyph clusters, avoiding duplicate combining marks and keycap components. Fallback chains are bounded to prevent runaway recursion, and interleaved or nested Android fallback requests retain the original font weight. (Fix, Fix)
  • Incorrect fitted text size: Text using variable-font-axis modifiers could fit against stale modifier coverage, producing an incorrect size or overflow. Coverage now updates before the font-size fitting calculation. (Fix)
  • Text backgrounds ignoring opacity changes: Backgrounds on global text styles now respond to opacity-only updates. (Fix)
  • Memory growth from repeated view model lookups: Repeated lookups created additional native wrappers. The runtime now reuses them, and Legacy lookups also reuse their Kotlin wrappers and acquire the file lock. (Fix)
  • Concurrent artboard instancing: Instancing could mutate shared source data concurrently, leading to memory corruption. Shared source mutations are now synchronized. The Legacy API also serializes artboard and state machine creation with frame advancement to protect script initialization and shared runtime state. (Fix, Fix, Fix)
  • Command queue synchronization: Checking for pending commands outside the stream lock could race with enqueuing work. The check now happens under the lock. (Fix)
  • Vulkan startup crashes on affected Android drivers: Querying optional surface formats could crash inside the vendor graphics allocator, including on the realme C65 5G. Android now avoids that query when the required RGBA8 hardware-buffer format is supported. (Fix)
  • Virtualized rows stacking after being hidden: A hidden list could measure its rows as zero-height, causing them to overlap when shown again. It now preserves their sizes while hidden. (Fix)
  • Keyboard navigation skipping virtualized rows: Tab and Shift+Tab now reveal and instantiate the next row before moving focus into it. Recycled rows also stop contributing stale focus targets. (Fix)
  • Mounted artboards losing their data binding or crashing: An artboard mounted from another file could lose its own view model or encounter invalidated references when its host rebound data. It now retains its own binding and uses its own view model as the root. (Fix, Fix)
  • Cleared artboard slots retaining content and audio: Clearing a slot directly in a hidden layout now releases its artboard on the next update, including its audio. This does not yet cover slots inside hidden list rows or beneath another hidden parent artboard. (Fix)
  • Script sounds outliving their artboard: Sounds started by scripts during initialization, advancement, or input now stop when their owning artboard is deleted. Sounds started from other contexts, such as asynchronous callbacks, are outside this ownership fix. (Fix)
  • Nested script nodes intercepting unrelated pointer events: Scripted drawables and layouts in nested artboards now respect the artboard's bounds and clipping, while continuing to receive movement for an active press. (Fix)
  • Scripts missing global view models during initialization: Reading a global before a data context was bound could leave a script with nil permanently. Initialization now waits for the data context and retries. A host must bind a data context for initialization that reads globals to finish. (Fix)
  • Incorrect bounds: Nested artboards and skinned paths could report incorrect geometry, affecting bounds queries and accessibility semantics. Nested artboards now contribute their box, skinned paths avoid applying the world transform twice, and hidden-path bounds refresh correctly. (Fix)
  • Two layer masks sharing a source: One mask could receive empty coverage when another mask used the same source. Both now receive the source content. (Fix)
  • GPU Canvas shader bindings: OpenGL now handles depth textures read both with and without comparison sampling, and clears stale comparison samplers before later reads. Shader entry points that share a binding can use their own declared layout, with invalid combinations reported to scripts. (Fix, Fix, Fix)

Behavior changes

Capture listeners observe presses by default

A capture-phase press listener now lets the press continue into nested content unless its Stop Propagation flag is enabled in the Rive Editor. This affects existing files too. If a capture listener is intended to take the press from content inside its target, enable that flag. Target opacity still governs what is blocked underneath, rather than what is inside. Capture drag listeners can still take over a nested gesture when the drag begins. (Change)

Focus movement returns a result

StateMachine.moveFocus(direction) is now suspending and returns RiveFocusMoveResult, containing whether focus moved and the resulting focus state. Callers must invoke it from a coroutine. RiveFocusDirection adds Left, Right, Up, and Down. (Change)

Asset registration types

Asset registration is now represented by RegisterableAsset, implemented by image, audio, and font assets through ReferencedAsset. Blob assets do not support registration. Code that registers assets through the generic Asset<*> base type must use RegisterableAsset instead. (Change)

Font callbacks and file manifests

Custom font fallback callbacks can now run concurrently, including for the same uncached request, and must be thread-safe. File manifest assets are handled internally and are no longer passed to FileAssetLoader callbacks. (Change, Change)

Unsupported GPU storage textures

GPU Canvas pipelines now reject WGSL storage textures at creation, including in previously exported files. These textures have no supported binding path, and accepting them could leave Vulkan draws with unwritten bindings. (Change)

Known issues

Keyboard handling in ancestor listeners

Android currently decides whether to consume a key using the focused element's keyboard listeners. A key handled only by an ancestor listener can also reach the surrounding Android UI. For example, Escape may close a Rive dialog and also trigger Android Back. (Change)

Script-created artboards from decoded files

Image, font, and blob properties on a decoded artboard's view model are still looked up in the calling script's file, rather than the decoded file. Scripts in the decoded file also start at display scale 1 and do not receive scale changes. The host script can access the decoded root's main view model through data, but not its global instances. Separately, an artboard copied from the script's own file during init, before the host binds a data context, does not acquire globals afterward. (Change)

Performance

Skipping unchanged draws

This release avoids redrawing a surface when its content has not changed. Advancement and asynchronous work continue as needed, while changes to content, dimensions, or rendering parameters trigger a new draw. Hardware-buffer presentation also avoids producing a new frame for a skipped draw. This reduces unnecessary rendering work for settled content. (Change)

Faster artboard instancing

Artboard instancing now looks up data binds by their target instead of scanning every bind for every object. In a release-build C++ benchmark on an M-series Mac, taking the best of five runs, an artboard with about 26,000 objects and 1,946 data binds went from 41.2 ms to 5.4 ms, an 87% reduction. This illustrates one improvement, and gains depend on the content. (Change)

Instancing also avoids repeated scans when building draw targets and builds each nested artboard's focus tree once, reducing work even for content that does not use focus. (Change, Change)

Creating hidden nested artboards on demand

Files using the new Load hidden nested artboards on show setting defer creating collapsed nested artboard instances until they are first shown or accessed. Once created, an instance stays alive when hidden again so it retains its state. This is independent of the file's deferDecoding option. (Change)

The setting is on for newly created documents. Existing documents retain eager instancing when re-exported unless the setting is enabled. In a release-build C++ benchmark on an M-series Mac, a clock scene created 178 instances instead of 2,524 at load. Instancing time fell from 7.79 ms to 0.60 ms, and heap use at instancing fell from 20.9 MB to 1.65 MB. The first frame showing a previously hidden digit cost up to about 0.3 ms more. Gains and first-use costs depend on the content.

Less work in component lists

Unchanged list rows can now stop advancing when their text uses stateful global styles, or when their scripted drawables and path effects report that they have settled. Scripts that cannot reliably report changes still keep their rows active. Focus-row synchronization also avoids repeated scans, and pointer handling transforms coordinates into list space once rather than once per row. (Change, Change, Change, Change)

Fewer allocations and copies

Formula converters reuse evaluation storage, and drawing reuses clip storage instead of allocating it repeatedly. Loading image and audio assets avoids an extra full copy of their bytes into the command queue, and queued names and paths reuse owned strings. (Change, Change, Change, Change)

Less path and paint work

Unchanged path effects before the final effect in a chain now reuse their results instead of recomputing them every update. Plain paints also bypass work needed only for paint images. Path rendering reduces vertex-shader texture reads and moves stroke-outset calculations into tessellation. (Change, Change, Change, Change)

Parallel GPU Canvas shader linking

On OpenGL drivers with KHR_parallel_shader_compile, GPU Canvas replay can start compiling and linking multiple pipelines before waiting for their results. This reduces serialization during setup of content with multiple scripted GPU pipelines. Drivers without the extension retain synchronous linking, and a pipeline may still require a wait when first used. (Change)


Full comparison

Don't miss a new rive-android release

NewReleases is sending notifications on new releases.