Class AnticipateOvershootInterpolator

java.lang.Object
icyllis.modernui.animation.AnticipateOvershootInterpolator
All Implemented Interfaces:
TimeInterpolator

public class AnticipateOvershootInterpolator extends Object implements TimeInterpolator
An interpolator where the change starts backward then flings forward and overshoots the target value and finally goes back to the final value.
  • Constructor Details

    • AnticipateOvershootInterpolator

      public AnticipateOvershootInterpolator()
      See Also:
    • AnticipateOvershootInterpolator

      public AnticipateOvershootInterpolator(float tension)
      Parameters:
      tension - Amount of anticipation/overshoot. When tension equals 0.0f, there is no anticipation/overshoot and the interpolator becomes a simple acceleration/deceleration interpolator.
    • AnticipateOvershootInterpolator

      public AnticipateOvershootInterpolator(float tension, float extraTension)
      Parameters:
      tension - Amount of anticipation/overshoot. When tension equals 0.0f, there is no anticipation/overshoot and the interpolator becomes a simple acceleration/deceleration interpolator.
      extraTension - Amount by which to multiply the tension. For instance, to get the same overshoot as an OvershootInterpolator with a tension of 2.0f, you would use an extraTension of 1.5f.
  • Method Details

    • getInterpolation

      public float getInterpolation(float t)
      Description copied from interface: TimeInterpolator
      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.
      Specified by:
      getInterpolation in interface TimeInterpolator
      Parameters:
      t - [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.