You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Android: settled RiveViews keep drawing every vsync (render loop only stops when paused) #424
On Android (src/new, rive-android 11.12.1, @rive-app/react-native 0.5.5), the Choreographer render loop in RiveReactNativeView.kt calls worker.draw(...) on every frame unless the view is paused:
if (paused &&!needsRedraw) { … return }
…
if (!paused &&!settled) worker.advanceStateMachine(sm, deltaTime)
worker.draw(art, sm, rs, activeFit, …) // runs every frame while not paused
A settled state machine stops advancing but is still redrawn every vsync. In our app, four small control views (autoPlay, data-bound, no looping timelines) kept the UI thread busy at about 30–44 ms per frame while nothing on screen changed (Surface Duo, dumpsys gfxinfo: about 260 frames in 5 s).
Two contributing factors:
The loop's skip condition ignores settled. if ((paused || settled) && !needsRedraw) would fix it.
settled is only set from the deprecated CommandQueue.settledFlow, which is fed by StateMachineSettlingStore. That store only accepts a settlement matching a pending request ID, set by unsettle, and the view never calls unsettle. In our testing settled never became true, so fixing (1) alone made no measurable difference. This is from reading the 11.12.1 bytecode plus device measurements; we didn't add native logging.
Workaround in our app: pause() the view about 600 ms after the last view-model write (longest timeline × 2), and resume with playIfNeeded(). Idle frames went from about 260 to 0 per 5 s, and controls still animate on input.
Happy to open a PR for (1) and wire the view to the non-deprecated settle API if you can point at the intended public surface.
Thanks for the detailed report. We reproduced it on main: with a few settled, data-bound views the Android backend keeps drawing every frame (~250 frames per 5 s while idle). A PR would be very welcome. Our battery fix in #416 also touches this render loop and may land as well, but please go ahead if you'd like to open one.
Activity
mfazekas commentedon Oct 17, 2026
Thanks for the detailed report. We reproduced it on main: with a few settled, data-bound views the Android backend keeps drawing every frame (~250 frames per 5 s while idle). A PR would be very welcome. Our battery fix in #416 also touches this render loop and may land as well, but please go ahead if you'd like to open one.