DecelerateInterpolatorpublic class DecelerateInterpolator extends BaseInterpolator implements com.android.internal.view.animation.NativeInterpolatorFactoryAn 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
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)
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 long | createNativeInterpolator()
return NativeInterpolatorFactoryHelper.createDecelerateInterpolator(mFactor);
| public float | getInterpolation(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;
|
|