Interface TimeInterpolator

All Known Implementing Classes:
AnticipateOvershootInterpolator, BounceInterpolator
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface TimeInterpolator
An interpolator defines the rate of change of an animation. This allows animations to have non-linear motion, such as acceleration and deceleration.
  • Field Details

  • Method Details

    • getInterpolation

      float getInterpolation(float progress)
      Get interpolation value. This interpolated value is then multiplied by the change in value of an animation to derive the animated value at the current elapsed animation time.
      Parameters:
      progress - [0.0, 1.0] determined by timeline, 0.0 represents the start and 1.0 represents the end
      Returns:
      the interpolated value. this value can be more than 1.0 for those overshoot their targets, or less than 0 for those undershoot their targets.
    • linear

      @NonNull static TimeInterpolator linear()
      Return a linear interpolator (identity).
      Returns:
      a linear interpolator
    • accelerate

      @NonNull static TimeInterpolator accelerate()
      Return an interpolator where the rate of change starts out slowly and then accelerates.
      Returns:
      an accelerate interpolator
    • accelerate

      @NonNull static TimeInterpolator accelerate(float factor)
      Create an interpolator where the rate of change starts out slowly and then accelerates.
      Parameters:
      factor - acceleration factor
      Returns:
      an accelerate interpolator
    • decelerate

      @NonNull static TimeInterpolator decelerate()
      Return an interpolator where the rate of change starts out quickly and then decelerates.
      Returns:
      a decelerate interpolator
    • decelerate

      @NonNull static TimeInterpolator decelerate(float factor)
      Create an interpolator where the rate of change starts out quickly and then decelerates.
      Parameters:
      factor - deceleration factor
      Returns:
      a decelerate interpolator
      See Also:
    • cycle

      @NonNull static TimeInterpolator cycle(float cycle)
      Create a cycle interpolator which repeats the animation for a specified number of cycles. The rate of change follows a sinusoidal pattern. If cycle is 0.25f, a constant object will be returned.
    • anticipate

      @NonNull static TimeInterpolator anticipate()
      Return an interpolator where the change starts backward then flings forward.
      Returns:
      an anticipate interpolator
    • anticipate

      @NonNull static TimeInterpolator anticipate(float tension)
      Create an interpolator where the change starts backward then flings forward.
      Parameters:
      tension - anticipation tension
      Returns:
      an anticipate interpolator
    • overshoot

      @NonNull static TimeInterpolator overshoot()
      Return an interpolator where the change flings forward and overshoots the last value then comes back.
      Returns:
      an overshoot interpolator
    • overshoot

      @NonNull static TimeInterpolator overshoot(float tension)
      Create an interpolator where the change flings forward and overshoots the last value then comes back.
      Parameters:
      tension - overshoot tension
      Returns:
      an overshoot interpolator
    • bounce

      @NonNull static TimeInterpolator bounce()
      Return an interpolator where the change bounces at the end.
      Returns:
      a bounce interpolator