FileDocCategorySizeDatePackage
OvershootInterpolator.javaAPI DocAndroid 5.1 API2785Thu Mar 12 22:22:10 GMT 2015android.view.animation

OvershootInterpolator

public class OvershootInterpolator extends BaseInterpolator implements com.android.internal.view.animation.NativeInterpolatorFactory
An interpolator where the change flings forward and overshoots the last value then comes back.

Fields Summary
private final float
mTension
Constructors Summary
public OvershootInterpolator()

        mTension = 2.0f;
    
public OvershootInterpolator(float tension)

param
tension Amount of overshoot. When tension equals 0.0f, there is no overshoot and the interpolator becomes a simple deceleration interpolator.

        mTension = tension;
    
public OvershootInterpolator(android.content.Context context, android.util.AttributeSet attrs)

        this(context.getResources(), context.getTheme(), attrs);
    
public OvershootInterpolator(android.content.res.Resources res, android.content.res.Resources.Theme theme, android.util.AttributeSet attrs)

hide

        TypedArray a;
        if (theme != null) {
            a = theme.obtainStyledAttributes(attrs, R.styleable.OvershootInterpolator, 0, 0);
        } else {
            a = res.obtainAttributes(attrs, R.styleable.OvershootInterpolator);
        }

        mTension = a.getFloat(R.styleable.OvershootInterpolator_tension, 2.0f);
        setChangingConfiguration(a.getChangingConfigurations());
        a.recycle();
    
Methods Summary
public longcreateNativeInterpolator()

hide

        return NativeInterpolatorFactoryHelper.createOvershootInterpolator(mTension);
    
public floatgetInterpolation(float t)

        // _o(t) = t * t * ((tension + 1) * t + tension)
        // o(t) = _o(t - 1) + 1
        t -= 1.0f;
        return t * t * ((mTension + 1) * t + mTension) + 1.0f;