OvershootInterpolatorpublic class OvershootInterpolator extends BaseInterpolator implements com.android.internal.view.animation.NativeInterpolatorFactoryAn interpolator where the change flings forward and overshoots the last value
then comes back. |
Fields Summary |
---|
private final float | mTension |
Constructors Summary |
---|
public OvershootInterpolator()
mTension = 2.0f;
| public OvershootInterpolator(float tension)
mTension = tension;
| public OvershootInterpolator(android.content.Context context, android.util.AttributeSet attrs)
this(context.getResources(), context.getTheme(), attrs);
| public OvershootInterpolator(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.OvershootInterpolator, 0, 0);
} else {
a = res.obtainAttributes(attrs, R.styleable.OvershootInterpolator);
}
mTension = a.getFloat(R.styleable.OvershootInterpolator_tension, 2.0f);
setChangingConfiguration(a.getChangingConfigurations());
a.recycle();
|
Methods Summary |
---|
public long | createNativeInterpolator()
return NativeInterpolatorFactoryHelper.createOvershootInterpolator(mTension);
| public float | getInterpolation(float t)
// _o(t) = t * t * ((tension + 1) * t + tension)
// o(t) = _o(t - 1) + 1
t -= 1.0f;
return t * t * ((mTension + 1) * t + mTension) + 1.0f;
|
|