Package icyllis.modernui.animation

# 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 Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final TimeInterpolator`
  `ACCELERATE`
  The constant accelerate interpolator whose factor is 1.0.
  `static final TimeInterpolator`
  `ACCELERATE_DECELERATE`
  The interpolator where the rate of change starts and ends slowly but accelerates through the middle.
  `static final TimeInterpolator`
  `ANTICIPATE`
  The constant anticipate interpolator whose tension is 2.0.
  `static final TimeInterpolator`
  `ANTICIPATE_OVERSHOOT`
  The constant anticipate/overshoot interpolator whose tension is 2.0.
  `static final TimeInterpolator`
  `BOUNCE`
  The bounce interpolator where the change bounces at the end.
  `static final TimeInterpolator`
  `DECELERATE`
  The constant decelerate interpolator whose factor is 1.0.
  `static final TimeInterpolator`
  `DECELERATE_CUBIC`
  The constant decelerate interpolator whose factor is 1.5.
  `static final TimeInterpolator`
  `DECELERATE_QUINTIC`
  The constant decelerate interpolator whose factor is 2.5.
  `static final TimeInterpolator`
  `LINEAR`
  The linear interpolator.
  `static final TimeInterpolator`
  `OVERSHOOT`
  The constant overshoot interpolator whose tension is 2.0.
  `static final TimeInterpolator`
  `SINE`
  The constant cycle interpolator that indicates 1/4 cycle sine wave.
  `static final TimeInterpolator`
  `VISCOUS_FLUID`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static TimeInterpolator`
  `accelerate()`
  Return an interpolator where the rate of change starts out slowly and then accelerates.
  `static TimeInterpolator`
  `accelerate(float factor)`
  Create an interpolator where the rate of change starts out slowly and then accelerates.
  `static TimeInterpolator`
  `anticipate()`
  Return an interpolator where the change starts backward then flings forward.
  `static TimeInterpolator`
  `anticipate(float tension)`
  Create an interpolator where the change starts backward then flings forward.
  `static TimeInterpolator`
  `bounce()`
  Return an interpolator where the change bounces at the end.
  `static TimeInterpolator`
  `cycle(float cycle)`
  Create a cycle interpolator which repeats the animation for a specified number of cycles.
  `static TimeInterpolator`
  `decelerate()`
  Return an interpolator where the rate of change starts out quickly and then decelerates.
  `static TimeInterpolator`
  `decelerate(float factor)`
  Create an interpolator where the rate of change starts out quickly and then decelerates.
  `float`
  `getInterpolation(float progress)`
  Get interpolation value.
  `static TimeInterpolator`
  `linear()`
  Return a linear interpolator (identity).
  `static TimeInterpolator`
  `overshoot()`
  Return an interpolator where the change flings forward and overshoots the last value then comes back.
  `static TimeInterpolator`
  `overshoot(float tension)`
  Create an interpolator where the change flings forward and overshoots the last value then comes back.

- ## Field Details

  - ### LINEAR

    @NonNull static final TimeInterpolator LINEAR
    The linear interpolator.

  - ### ACCELERATE

    @NonNull static final TimeInterpolator ACCELERATE
    The constant accelerate interpolator whose factor is 1.0.
    See Also:
      - `accelerate(float)`

  - ### DECELERATE

    @NonNull static final TimeInterpolator DECELERATE
    The constant decelerate interpolator whose factor is 1.0.
    See Also:
      - `decelerate(float)`

  - ### DECELERATE_CUBIC

    @NonNull static final TimeInterpolator DECELERATE_CUBIC
    The constant decelerate interpolator whose factor is 1.5.
    See Also:
      - `decelerate(float)`

  - ### DECELERATE_QUINTIC

    @NonNull static final TimeInterpolator DECELERATE_QUINTIC
    The constant decelerate interpolator whose factor is 2.5.
    See Also:
      - `decelerate(float)`

  - ### ACCELERATE_DECELERATE

    @NonNull static final TimeInterpolator ACCELERATE_DECELERATE
    The interpolator where the rate of change starts and ends slowly but accelerates through the middle.

  - ### SINE

    @NonNull static final TimeInterpolator SINE
    The constant cycle interpolator that indicates 1/4 cycle sine wave.
    See Also:
      - `cycle(float)`

  - ### ANTICIPATE

    @NonNull static final TimeInterpolator ANTICIPATE
    The constant anticipate interpolator whose tension is 2.0.
    See Also:
      - `anticipate(float)`

  - ### OVERSHOOT

    @NonNull static final TimeInterpolator OVERSHOOT
    The constant overshoot interpolator whose tension is 2.0.
    See Also:
      - `overshoot(float)`

  - ### ANTICIPATE_OVERSHOOT

    @NonNull static final TimeInterpolator ANTICIPATE_OVERSHOOT
    The constant anticipate/overshoot interpolator whose tension is 2.0.
    See Also:
      - `AnticipateOvershootInterpolator`

  - ### BOUNCE

    @NonNull static final TimeInterpolator BOUNCE
    The bounce interpolator where the change bounces at the end.

  - ### VISCOUS_FLUID

    @NonNull static final TimeInterpolator VISCOUS_FLUID

- ## 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:
      - `DECELERATE`
      - `DECELERATE_CUBIC`
      - `DECELERATE_QUINTIC`

  - ### 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