酷炫动画
http://blog.youkuaiyun.com/easyer2012/article/details/50483930
基本动画
http://blog.youkuaiyun.com/lmj623565791/article/details/38067475/
平移动画,
动画播出之后控件会停留在移动后的位置。
// 动画实际执行 public static void startPropertyAnim(View image_jiantou, int i) { // X轴方向上的坐标 ObjectAnimator anim; // 向右移动500pix,然后再移动到原来的位置复原。 // 参数“translationX”指明在x坐标轴位移,即水平位移。 if (i == 0) { float translationX = image_jiantou.getTranslationX(); anim = ObjectAnimator.ofFloat(image_jiantou, "translationX", translationX, 300f,0f ); } else { float translationX = image_jiantou.getTranslationX(); anim = ObjectAnimator.ofFloat(image_jiantou, "translationX", translationX, 300f, 520f); } anim.setDuration(2000); // 正式开始启动执行动画 anim.start(); }
隐身动画: 从模糊到清晰
RelativeLayout rootLayout = (RelativeLayout) findViewById(R.id.splash_root); AlphaAnimation animation = new AlphaAnimation(0.3f, 1.0f); animation.setDuration(1500); rootLayout.startAnimation(animation);