Package 

Class RiveBlock


  • 
    public final class RiveBlock
    
                        

    Server-driven Rive animation block.

    SPEC-070-A E.3 — replaces the stub placeholder with a real RiveAnimationView hosted via AndroidView. Compose-only Rive APIs are still nascent (RiveAnimation Composable shipped late and depends on the same View under the hood), so we use the battle-tested View directly and wrap it with DisposableEffect to stop the animation + release native resources when the composition leaves the tree (E.4).

    iOS parity: packages/appdna-sdk-ios/Sources/AppDNASDK/Core/RiveBlockView.swift uses RiveViewModel(name:, stateMachineName:, fit:, alignment:) from RiveRuntime. The Android RiveAnimationView matches that surface — setRiveResource(url, stateMachineName, autoplay) plus input setters mirror the iOS setInput(_:value:) calls.

    Boolean and number inputs are propagated from RiveBlock.inputs; trigger inputs (named in RiveBlock.trigger_on_step_complete) are fired by callers (e.g. OnboardingFlowHost) via fireTrigger — we expose the view through a side-effect channel by storing it in remember so the host can reach in.