/**
* 自由落体
*
* @param view
*/
public void verticalRun(View view)
{
ValueAnimator animator = ValueAnimator.ofFloat(0, mScreenHeight
- mBlueBall.getHeight());
//animator.setTarget(mBlueBall);
animator.setDuration(1000).start();
animator.setInterpolator(new BounceInterpolator());
animator.addUpdateListener(new AnimatorUpdateListener()
{
@Override
public void onAnimationUpdate(ValueAnimator animation)
{
mBlueBall.setTranslationY((Float) animation.getAnimatedValue());
}
});
}
ValueAnimatorActivity.java 文件源码
java
阅读 26
收藏 0
点赞 0
评论 0
项目:Android_Study_Demos
作者:
评论列表
文章目录