fix(ui): match the iOS number roll in AnimatedNumberText - #1662
Merged
Merged
Conversation
Compared against a 60fps recording of the iOS market cap readout, which uses `.contentTransition(.numericText())` with `.snappy`: - Stagger: iOS starts each character about a frame after the one to its left. Android started every slot on the same frame, which read as abrupt. Each slot now waits 12ms per position, but only from rest; a slot already rolling retargets immediately so a scrub can't keep re-delaying it. - Quick scrubs held a digit: every value change restarted the slot's animation from rest, so a value changing each frame barely moved. Each slot now runs one spring loop and a change only updates its target, keeping velocity. - Mid-roll gaps: the outgoing glyph faded out before the incoming one faded in, so the slot went blank. The fades now overlap (out by 0.7, in over 0.2..0.9), leaving two dim smudges like iOS. - Settle: damping 0.85, from `.snappy`'s 0.15 bounce. Stiffness stays at 380, which matched iOS's per-digit timing in the recording. - New leading digits drew over the "$": the resize clip sat inside the slot's width layout, so it clipped to the glyph's full width. It now sits outside. - Blur cut off square: Android renders a RenderEffect into a layer the size of its node, so each glyph's blur stopped at its own edges, visible on the last digit. Glyph layers are padded by the blur radius without changing the cell size.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Android number roll felt faster and more abrupt than iOS. Frame-by-frame comparison against a 60fps recording of the iOS market cap readout (
.contentTransition(.numericText())with.snappy) showed the difference was mostly in how the digits move together, not the spring speed..snappy's 0.15 bounce$while its slot widensNotes:
.defaultmade each digit slower than iOS.RenderEffectinto a layer the size of its node. Padding the glyph layer byMaxBlurgives the blur room without changing the cell's measured size.AnimatedNumberText: token cards, balance rows, market cap, the explainer, link cards and the amount area.New tests:
digits start left to rightanda digit changing every frame still rolls out, both failing before the change.