我想创建一个自定义插值器来应用平移动画,动画应该通过以下函数进行处理:
如何使用上述函数创建插值来进行翻译。
public static float easeIn(float t,float b , float c, float d) {
return c*(t/=d)*t + b;
}
位置:
t: current time
b: start value
c: change in value
d: duration
我发现了一种实现缩放动画的方法,只需传入一个参数:
import android.view.animation.Interpolator;
public class MyInterpolator implements Interpolator {
public MyInterpolator() {
}
public float getInterpolation(float t) {
float x = 2.0f * t - 1.0f;
return 0.5f * (x * x * x + 1.0f);
}
}
如何使用上述函数创建插值来进行翻译。