欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

属性动画

程序员文章站 2022-03-02 19:38:13
...
  1. AnimatorSet set = new AnimatorSet();
    ObjectAnimator scale = ObjectAnimator.ofFloat(textView,“scaleY”,1,3);
    ObjectAnimator alpha = ObjectAnimator.ofFloat(textView,“alpha”,1, (float) 0.8);
    ObjectAnimator rotate = ObjectAnimator.ofFloat(textView,“rotationX”,0f,360f);
    set.play(scale).with(alpha).with(rotate);
    set.setDuration(2000);
    set.start();
    set.addListener(new Animator.AnimatorListener() {
    @Override
    public void onAnimationStart(Animator animation) {

        }
    
        @Override
        public void onAnimationEnd(Animator animation) {
            startActivity(new Intent(MainActivity.this,Main2Activity.class));
        }
    
        @Override
        public void onAnimationCancel(Animator animation) {
    
        }
    
        @Override
        public void onAnimationRepeat(Animator animation) {
    
        }
    });