Class TimedAnimation

All Implemented Interfaces:
PointerInterface

public class TimedAnimation extends Animation
A time-based [class@Animation].

`AdwTimedAnimation` implements a simple animation interpolating the given
value from [property@TimedAnimation:value-from] to
[property@TimedAnimation:value-to] over
[property@TimedAnimation:duration] milliseconds using the curve described by
[property@TimedAnimation:easing].

If [property@TimedAnimation:reverse] is set to `TRUE`, `AdwTimedAnimation`
will instead animate from [property@TimedAnimation:value-to] to
[property@TimedAnimation:value-from], and the easing curve will be inverted.

The animation can repeat a certain amount of times, or endlessly, depending
on the [property@TimedAnimation:repeat-count] value. If
[property@TimedAnimation:alternate] is set to `TRUE`, it will also change the
direction every other iteration.

https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.TimedAnimation.html

  • Constructor Details

    • TimedAnimation

      public TimedAnimation(PointerContainer pointer)
    • TimedAnimation

      public TimedAnimation(@Nonnull Widget widget, double from, double to, int duration, @Nonnull AnimationTarget target)
      Creates a new `AdwTimedAnimation` on @widget to animate @target from @from
      to @to.
      Parameters:
      widget - a widget to create animation on
      from - a value to animate from
      to - a value to animate to
      duration - a duration for the animation
      target - a target value to animate
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getAlternate

      public boolean getAlternate()
      Gets whether @self changes direction on every iteration.
      Returns:
      whether @self alternates
    • getDuration

      public int getDuration()
      Gets the duration of @self.
      Returns:
      the duration of @self, in milliseconds
    • getEasing

      public int getEasing()
      Gets the easing function @self uses.
      Returns:
      the easing function @self uses
    • getRepeatCount

      public int getRepeatCount()
      Gets the number of times @self will play.
      Returns:
      the number of times @self will play
    • getReverse

      public boolean getReverse()
      Gets whether @self plays backwards.
      Returns:
      whether @self plays backwards
    • getValueFrom

      public double getValueFrom()
      Gets the value @self will animate from.
      Returns:
      the value to animate from
    • getValueTo

      public double getValueTo()
      Gets the value @self will animate to.
      Returns:
      the value to animate to
    • setAlternate

      public void setAlternate(boolean alternate)
      Sets whether @self changes direction on every iteration.
      Parameters:
      alternate - whether @self alternates
    • setDuration

      public void setDuration(int duration)
      Sets the duration of @self.

      If the animation repeats more than once, sets the duration of one iteration.
      Parameters:
      duration - the duration to use, in milliseconds
    • setEasing

      public void setEasing(int easing)
      Sets the easing function @self will use.

      See [enum@Easing] for the description of specific easing functions.
      Parameters:
      easing - the easing function to use
    • setRepeatCount

      public void setRepeatCount(int repeat_count)
      Sets the number of times @self will play.

      If set to 0, @self will repeat endlessly.
      Parameters:
      repeat_count - the number of times @self will play
    • setReverse

      public void setReverse(boolean reverse)
      Sets whether @self plays backwards.
      Parameters:
      reverse - whether @self plays backwards
    • setValueFrom

      public void setValueFrom(double value)
      Sets the value @self will animate from.

      The animation will start at this value and end at
      [property@TimedAnimation:value-to].

      If [property@TimedAnimation:reverse] is `TRUE`, the animation will end at
      this value instead.
      Parameters:
      value - the value to animate from
    • setValueTo

      public void setValueTo(double value)
      Sets the value @self will animate to.

      The animation will start at [property@TimedAnimation:value-from] and end at
      this value.

      If [property@TimedAnimation:reverse] is `TRUE`, the animation will start
      at this value instead.
      Parameters:
      value - the value to animate to
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()