FileDocCategorySizeDatePackage
AccelerateInterpolator.javaAPI DocAndroid 5.1 API3003Thu Mar 12 22:22:10 GMT 2015android.view.animation

AccelerateInterpolator

public class AccelerateInterpolator extends BaseInterpolator implements com.android.internal.view.animation.NativeInterpolatorFactory
An interpolator where the rate of change starts out slowly and and then accelerates.

Fields Summary
private final float
mFactor
private final double
mDoubleFactor
Constructors Summary
public AccelerateInterpolator()

        mFactor = 1.0f;
        mDoubleFactor = 2.0;
    
public AccelerateInterpolator(float factor)
Constructor

param
factor Degree to which the animation should be eased. Seting factor to 1.0f produces a y=x^2 parabola. Increasing factor above 1.0f exaggerates the ease-in effect (i.e., it starts even slower and ends evens faster)

        mFactor = factor;
        mDoubleFactor = 2 * mFactor;
    
public AccelerateInterpolator(android.content.Context context, android.util.AttributeSet attrs)

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

        mFactor = a.getFloat(R.styleable.AccelerateInterpolator_factor, 1.0f);
        mDoubleFactor = 2 * mFactor;
        setChangingConfiguration(a.getChangingConfigurations());
        a.recycle();
    
Methods Summary
public longcreateNativeInterpolator()

hide

        return NativeInterpolatorFactoryHelper.createAccelerateInterpolator(mFactor);
    
public floatgetInterpolation(float input)

        if (mFactor == 1.0f) {
            return input * input;
        } else {
            return (float)Math.pow(input, mDoubleFactor);
        }