AccelerateInterpolatorpublic class AccelerateInterpolator extends BaseInterpolator implements com.android.internal.view.animation.NativeInterpolatorFactoryAn 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
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)
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 long | createNativeInterpolator()
return NativeInterpolatorFactoryHelper.createAccelerateInterpolator(mFactor);
| public float | getInterpolation(float input)
if (mFactor == 1.0f) {
return input * input;
} else {
return (float)Math.pow(input, mDoubleFactor);
}
|
|