FileDocCategorySizeDatePackage
AnticipateInterpolator.javaAPI DocAndroid 5.1 API2713Thu Mar 12 22:22:10 GMT 2015android.view.animation

AnticipateInterpolator

public class AnticipateInterpolator extends BaseInterpolator implements com.android.internal.view.animation.NativeInterpolatorFactory
An interpolator where the change starts backward then flings forward.

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

        mTension = 2.0f;
    
public AnticipateInterpolator(float tension)

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

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

        this(context.getResources(), context.getTheme(), attrs);
    
public AnticipateInterpolator(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.AnticipateInterpolator, 0, 0);
        } else {
            a = res.obtainAttributes(attrs, R.styleable.AnticipateInterpolator);
        }

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

hide

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

        // a(t) = t * t * ((tension + 1) * t - tension)
        return t * t * ((mTension + 1) * t - mTension);