pub enum LayoutCurve {
Linear,
EaseIn,
EaseOut,
EaseInEaseOut,
Spring(Spring),
FittedSpring {
damping_ratio: f32,
},
Keyboard,
Bezier([f32; 4]),
}Expand description
Timing curve of a layout animation.
Variants§
Linear
Constant speed.
EaseIn
Accelerates.
EaseOut
Decelerates.
EaseInEaseOut
Accelerates, then decelerates.
Spring(Spring)
A spring’s physics (LayoutTransition::spring): it times itself,
lasting until it settles (Spring::settle_ms), and moves the same
on every platform. The transition’s duration_ms is not used. Its
velocity and frame_rate are not either: a layout moves from rest
at the screen’s rate. JS names it with a type: "spring" phase’s
stiffness, damping or mass.
FittedSpring
A spring of this damping ratio fitted into the transition’s
duration, which each platform draws with its own spring: the JS
LayoutAnimation’s type: "spring" (springDamping) without a
stiffness, damping or mass. Rust prefers
LayoutCurve::Spring.
Keyboard
The software keyboard’s motion (type: "keyboard"): the curve the
system moves its keyboard with, timed from when the keyboard
started to move, so that what makes room for it moves with it (the
duration is the keyboard’s, keyboard_duration). Where there is no
software keyboard, or nothing moved it, it eases in and out.
Bezier([f32; 4])
A cubic Bézier [x1, y1, x2, y2] over the transition’s duration,
as CSS cubic-bezier() (type: "bezier" with bezier in JS):
the curve an app’s design names. The x of each control point is
clamped to 0..1.