如何在android中的视图上应用过渡动画方程

时间:2014-01-08 08:38:07

标签: java android android-animation

如果我有这样的转换方程:

 c*t/d + b

用于以下函数:

 public static float easeNone (float t,float b , float c, float d) {
                return c*t/d + b;
 }

如何在android中的视图中应用此功能?其中:

t: current time
b: start value
c: change in value
d: duration 

this link中的内容。想要做的是在一些动画中移动视图(即按钮),如上面的链接,其中给出了动画数学方程

1 个答案:

答案 0 :(得分:1)

查看 Android Timer

在onTick方法中执行此操作

 public void onTick(long millisUntilFinished) {
          long time = totaltime - millisUntilFinished;
          float x = easeNone(time, your parameters);
      }
相关问题