Android: settled RiveViews keep drawing every vsync (render loop only stops when paused)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- kotlin, react-native
- Domain
- mobile-dev
Research direction
Start in RiveReactNativeView.kt, at the Choreographer frame callback where the paused and needsRedraw skip check sits above worker.draw(...). Then trace how settled gets set from CommandQueue.settledFlow and StateMachineSettlingStore, and where unsettle would need to be called. Done means a settled view stops calling draw while idle, confirmed by frame counts in dumpsys gfxinfo. The second half, wiring to the non-deprecated settle API, needs a maintainer decision on the public surface first.
Written by the indexing model from the issue text.
Description
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. settledis only set from the deprecatedCommandQueue.settledFlow, which is fed byStateMachineSettlingStore. That store only accepts a settlement matching a pending request ID, set byunsettle, and the view never callsunsettle. In our testingsettlednever 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.
- Dominant language
- TypeScript
- Stars
- 155
- Forks
- 17
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 20
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rive-app/rive-nitro-react-native
-
[Android] Fit.Layout content stale after resize on the new backend (surface keeps creation size)Possibly taken @mfazekas claimed this 5 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
rive-app/rive-nitro-react-native#418 ·
Maintainers usually reply within 1 day
-
Rive drains battery in the background on AndroidPossibly taken @mfazekas claimed this 8 days ago. Openandroid bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
rive-app/rive-nitro-react-native#413 ·
Maintainers usually reply within 1 day
-
[Android] RiveFonts: loadFont({name}) fails for script fonts on OEM fonts.xml; systemFallback() is not script-aware (tofu for Thai/Hebrew/Arabic/CJK)Possibly taken @mfazekas claimed this 15 days ago. Openandroid bug
Difficulty 3/5 1-2 days Newbie friendliness 65/100
rive-app/rive-nitro-react-native#369 · 3 comments ·
Maintainers usually reply within 1 day
-
enhancement iOS
Difficulty 4/5 3-5 days Newbie friendliness 35/100
rive-app/rive-nitro-react-native#58 · 7 comments ·
Maintainers usually reply within 1 day
All issues in rive-app/rive-nitro-react-native
Similar issues
-
freshness freshness:observed-only
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
thoroc/context-radar#280 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
documentation story
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
bug category:billing priority:p3 track:fast
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
LanternOps/breeze#9223 ·
Maintainers usually reply within 1 day