属性组合动画

位移
ObjectAnimator moveIn = ObjectAnimator.ofFloat(img, "translationY", 0f, 300f);
旋转
ObjectAnimator rotate = ObjectAnimator.ofFloat(img, "rotation", 0f, 360f);
缩放
ObjectAnimator suofang = ObjectAnimator.ofFloat(img, "scaleX", 2f, 1f);
透明
ObjectAnimator fadeInOut = ObjectAnimator.ofFloat(img, "alpha", 1f, 0f, 1f);
//创建动画集合
AnimatorSet animSet = new AnimatorSet();
//同时运行
animSet.play(rotate).with(fadeInOut).with(moveIn).with(suofang);
//设置时长
animSet.setDuration(3000);
//开启动画
animSet.start();
动画的监听:
animSet.addListener(new Animator.AnimatorListener() {
    @Override
    public void onAnimationStart(Animator animation) {

    }

    @Override
    public void onAnimationEnd(Animator animation) {
        Intent intent = new Intent(JinchangActivity.this,MainActivity.class);
        startActivity(intent);
    }

    @Override
    public void onAnimationCancel(Animator animation) {

    }

    @Override
    public void onAnimationRepeat(Animator animation) {

    }
});

你可能感兴趣的:(属性组合动画)