<소스를 복사 하고싶으시거나  타자 치지 싫으신 분은 댓글 달아주세요 ^^>


작은 사이즈에서 점점 커지면서 나오는 애니메이션

Animation animation = new AlphaAnimation(0.0f, 1.0f);
            animation.setDuration(150);
            set.addAnimation(animation);
          
         animation = new ScaleAnimation(
           0f, 1f, 0f, 1f,
           Animation.RELATIVE_TO_SELF, 0.5f,
           Animation.RELATIVE_TO_SELF, 0.5f);
         animation.setDuration(250);
         set.setInterpolator(new AccelerateInterpolator());
       set.addAnimation(animation);



현재 사이즈에서 커지는 애니메이션

public ScaleAnimation DragAni(int w , int h){
        ScaleAnimation scale = new ScaleAnimation(1f, 1.3f, 1f, 1.3f , Animation.RELATIVE_TO_SELF, 0.5f , Animation.RELATIVE_TO_SELF , 0.5f); // 점점 커진다
        scale.setDuration(200);
        scale.setFillAfter(true); //애니메이션 끝난 후 고정
        scale.setFillEnabled(true);
        return scale;
    }



흔들리는 애니메이션

private Animation createFastRotateAnimation() {
        Animation rotate = new RotateAnimation(-3.0f,
                3.0f,
                Animation.RELATIVE_TO_SELF,
                0.9f,
                Animation.RELATIVE_TO_SELF,
                0.9f);
       rotate.setRepeatMode(Animation.REVERSE);
        rotate.setRepeatCount(Animation.INFINITE);
        rotate.setDuration(60);
        rotate.setInterpolator(new AccelerateDecelerateInterpolator());
       
        return rotate;
    }


+ Recent posts