FileDocCategorySizeDatePackage
DecelerateInterpolator.javaAPI DocAndroid 1.5 API2032Wed May 06 22:41:56 BST 2009android.view.animation

DecelerateInterpolator

public class DecelerateInterpolator extends Object implements Interpolator
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. Seting 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)

        TypedArray a =
            context.obtainStyledAttributes(attrs, com.android.internal.R.styleable.DecelerateInterpolator);
        
        mFactor = a.getFloat(com.android.internal.R.styleable.DecelerateInterpolator_factor, 1.0f);
        
        a.recycle();
    
Methods Summary
public floatgetInterpolation(float input)

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