SpringAnimation
A spring-based class@Animation.
AdwSpringAnimation
implements an animation driven by a physical model of a spring described by struct@SpringParams, with a resting position in property@SpringAnimation:value-to, stretched to property@SpringAnimation:value-from.
Since the animation is physically simulated, spring animations don't have a fixed duration. The animation will stop when the simulated spring comes to a rest - when the amplitude of the oscillations becomes smaller than property@SpringAnimation:epsilon, or immediately when it reaches property@SpringAnimation:value-to if property@SpringAnimation:clamp is set to TRUE
. The estimated duration can be obtained with property@SpringAnimation:estimated-duration.
Due to the nature of spring-driven motion the animation can overshoot property@SpringAnimation:value-to before coming to a rest. Whether the animation will overshoot or not depends on the damping ratio of the spring. See struct@SpringParams for more information about specific damping ratio values.
If property@SpringAnimation:clamp is TRUE
, the animation will abruptly end as soon as it reaches the final value, preventing overshooting.
Animations can have an initial velocity value, set via property@SpringAnimation:initial-velocity, which adjusts the curve without changing the duration. This makes spring animations useful for deceleration at the end of gestures.
If the initial and final values are equal, and the initial velocity is not 0, the animation value will bounce and return to its resting position.
Constructors
Creates a new AdwSpringAnimation
on @widget.
Properties
Estimated duration of the animation, in milliseconds.
Whether to skip the animation when animations are globally disabled.
The initial velocity to start the animation with.
Physical parameters describing the spring.
The animation state.
The target to animate.
Functions
Calculates the value @self will have at @time.
Calculates the velocity @self will have at @time.
This signal is emitted when the animation has been completed, either on its own or via calling method@Animation.skip.
Gets the precision of the spring.
Gets the estimated duration of @self, in milliseconds.
Gets whether @self should be skipped when animations are globally disabled.
Gets the initial velocity of @self.
Gets the physical parameters of the spring of @self.
Gets the current value of @self.
Gets the target @self animates.
Gets the value @self will animate from.
Gets the value @self will animate to.
Gets the current velocity of @self.
Sets the precision of the spring.
Sets whether to skip @self when animations are globally disabled.
Sets the initial velocity of @self.
Sets the physical parameters of the spring of @self.
Sets the target @self animates to @target.
Sets the value @self will animate from.
Sets the value @self will animate to.