java - 如何在android中的 View 上应用过渡动画方程

标签 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 中的 View 中应用此功能?其中:

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

类似于 this link 中的内容。想要做的是在某些动画中移动 View (即按钮),如上面的链接所示,其中给出了动画数学方程

最佳答案

看看Android Timer

在 onTick 方法中执行此操作

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

关于java - 如何在android中的 View 上应用过渡动画方程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20990565/

相关文章:

java - 使用 Mockito 测试增强的 Java 行为

java - 要使用哪个 Maven GlassFish 插件?

java - 如何使用抽屉导航嵌套 fragment ?

Android使用动画增长LinearLayout

返回 2 个屏幕时,Android Activity 返回过渡刹车

运行外部命令时Java无法获取完整错误

java - RecyclerView 不显示 arraylist 的所有属性

android - SimpleExpandableListAdapter 中的参数是如何利用的?

android - 是否可以在 Android4.4(Chrome) 上通过 HTML5/Pure javascript 播放器播放 protected mpeg-dash 流的可播放内容?

android - Lottie 动画库 Z 排序问题