FileDocCategorySizeDatePackage
DecelerateInterpolator.javaAPI DocAndroid 5.1 API2943Thu Mar 12 22:22:10 GMT 2015android.view.animation

DecelerateInterpolator

public class DecelerateInterpolator extends BaseInterpolator implements com.android.internal.view.animation.NativeInterpolatorFactory
An interpolator where the rate of change starts out quickly and and then decelerates.

Fields Summary
private float
mFactor
Constructors Summary
public DecelerateInterpolator()

    
public DecelerateInterpolator(float factor)
Constructor

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

        mFactor = factor;
    
public DecelerateInterpolator(android.content.Context context, android.util.AttributeSet attrs)

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

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

hide


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

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