### Class

# Adw SpringAnimation

#### Description [src]

    final class Adw.SpringAnimation : Adw.Animation
    {
      /* No available fields */
    }

A spring-based `AdwAnimation`.

`AdwSpringAnimation` implements an animation driven by a physical model of a spring described by `AdwSpringParams`, with a resting position in `AdwSpringAnimation:value-to`, stretched to `AdwSpringAnimation: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 `AdwSpringAnimation:epsilon`, or immediately when it reaches `AdwSpringAnimation:value-to` if `AdwSpringAnimation:clamp` is set to `TRUE`. The estimated duration can be obtained with `AdwSpringAnimation:estimated-duration`.

Due to the nature of spring-driven motion the animation can overshoot `AdwSpringAnimation:value-to` before coming to a rest. Whether the animation will overshoot or not depends on the damping ratio of the spring. See `AdwSpringParams` for more information about specific damping ratio values.

If `AdwSpringAnimation: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 `AdwSpringAnimation: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.

#### Ancestors

- AdwAnimation
- GObject

#### Constructors

###### adw_spring_animation_new

Creates a new `AdwSpringAnimation` on `widget`.

#### Instance methods

###### adw_spring_animation_calculate_value

Calculates the value `self` will have at `time`.

since: 1.3

###### adw_spring_animation_calculate_velocity

Calculates the velocity `self` will have at `time`.

since: 1.3

###### adw_spring_animation_get_clamp

Gets whether `self` should be clamped.

###### adw_spring_animation_get_epsilon

Gets the precision of the spring.

###### adw_spring_animation_get_estimated_duration

Gets the estimated duration of `self`, in milliseconds.

###### adw_spring_animation_get_initial_velocity

Gets the initial velocity of `self`.

###### adw_spring_animation_get_spring_params

Gets the physical parameters of the spring of `self`.

###### adw_spring_animation_get_value_from

Gets the value `self` will animate from.

###### adw_spring_animation_get_value_to

Gets the value `self` will animate to.

###### adw_spring_animation_get_velocity

Gets the current velocity of `self`.

###### adw_spring_animation_set_clamp

Sets whether `self` should be clamped.

###### adw_spring_animation_set_epsilon

Sets the precision of the spring.

###### adw_spring_animation_set_initial_velocity

Sets the initial velocity of `self`.

###### adw_spring_animation_set_spring_params

Sets the physical parameters of the spring of `self`.

###### adw_spring_animation_set_value_from

Sets the value `self` will animate from.

###### adw_spring_animation_set_value_to

Sets the value `self` will animate to.

##### Methods inherited from AdwAnimation (12)

###### adw_animation_get_follow_enable_animations_setting

Gets whether `self` should be skipped when animations are globally disabled.

since: 1.3

###### adw_animation_get_state

Gets the current value of `self`.

###### adw_animation_get_target

Gets the target `self` animates.

###### adw_animation_get_value

Gets the current value of `self`.

###### adw_animation_get_widget

Gets the widget `self` was created for.

###### adw_animation_pause

Pauses a playing animation for `self`.

###### adw_animation_play

Starts the animation for `self`.

###### adw_animation_reset

Resets the animation for `self`.

###### adw_animation_resume

Resumes a paused animation for `self`.

###### adw_animation_set_follow_enable_animations_setting

Sets whether to skip `self` when animations are globally disabled.

since: 1.3

###### adw_animation_set_target

Sets the target `self` animates to `target`.

###### adw_animation_skip

Skips the animation for `self`.

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### Adw.SpringAnimation:clamp

Whether the animation should be clamped.

###### Adw.SpringAnimation:epsilon

Precision of the spring.

###### Adw.SpringAnimation:estimated-duration

Estimated duration of the animation, in milliseconds.

###### Adw.SpringAnimation:initial-velocity

The initial velocity to start the animation with.

###### Adw.SpringAnimation:spring-params

Physical parameters describing the spring.

###### Adw.SpringAnimation:value-from

The value to animate from.

###### Adw.SpringAnimation:value-to

The value to animate to.

###### Adw.SpringAnimation:velocity

Current velocity of the animation.

##### Properties inherited from AdwAnimation (5)

###### Adw.Animation:follow-enable-animations-setting

Whether to skip the animation when animations are globally disabled.

since: 1.3

###### Adw.Animation:state

The animation state.

###### Adw.Animation:target

The target to animate.

###### Adw.Animation:value

The current value of the animation.

###### Adw.Animation:widget

The animation widget.

#### Signals

##### Signals inherited from AdwAnimation (1)

###### AdwAnimation::done

This signal is emitted when the animation has been completed, either on its own or via calling `adw_animation_skip()`.

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct AdwSpringAnimationClass {
      /* no available fields */
    }

No description available.