我想創建一個自定義的插值申請翻譯動畫在動畫應該通過以下功能動畫:如何創建自定義插補申請翻譯Android中
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);
}
}
如何在內插中創建使用上述函數進行翻譯。