Springs
The numbers and curves everything moves by, the same on both phones; on the desktop, the curves and what moves along them.
Desktop
arkui::motion
arkui::motion
What moves a while and stops, on springs: a value sliding, something shown and hidden, whether to move at all, and a widget that draws what it holds moved, scaled and veiled.
Spring { damping, response }, state(x, v, t), or_instant()SMOOTH, INSTANT, FADEShown::new(spring, now), at(now), hide(now), show(now), moving(now), gone(now)Slide::new(from, to, now, spring), moving_at(speed), at(now), speed(now), toward(to, now, spring)reduced(), ALWAYS_ANIMATEtransformed(content, by, scale, veil, radius)
Rules
- Nothing ticks at rest: where a spring is, is worked out from the time whenever it is drawn.
- Sent somewhere else on its way, a move turns from where it is drawn at the speed it was going: nothing jumps.
- With less motion asked for (reduced), what slides or grows only fades.
- iced has no opacity for a group of widgets, so a fade is a veil of the ground over what fades, thinning.
Mobile
Where
ui/Springs.kt: Springs
How
- Springs.settle() and the rest: spring specs with a cap on how long any move takes.
Where
swift/ArkUI: Springs
How
- Springs.move, Springs.size, Springs.fade: Android's springs converted exactly (docs/plan-arkui-swift.md).