애니메이션 효과는 크게 2가지 있다.
1. Tweended animation : 뷰를 회전, 크기변경, 투명조절등의 에니메이션 방법
2. Frame-by-frame-animation :  연속된 이미지를 표시하는 에니메이션 방법

ALPHA = fromAlpha toAlpha – 0에서 1사이의 부동 소수

SCALE = fromXScale/toXScale - 0에서 1사이의 부동 소수

fromYScale/toYScale - 0에서 1사이의 부동 소수

pivotX/pivotY – 그림의 폭/높이는 0%에서 100%사이의 백분율로 나타낸 문자열

TRANSLATE = fromX/fromY - 0에서 1사이의 부동 소수

toX/toY - 0에서 1사이의 부동 소수

ROTATE = fromDegrees/toDegrees – 0에서 360 사이의 부동 소수

AnimationSet은 여러 animation을 쓰고자 할떄 쓴다.

ex)
public static void setLayoutAnim_slidedownfromtop(ViewGroup panel,int a) {

       AnimationSet set = new AnimationSet(true);

       Animation animation = new AlphaAnimation(0.0f, 1.0f);
       animation.setDuration(1000);
       set.addAnimation(animation);
      
       if(a==1){
       animation = new TranslateAnimation(
           Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f,
           Animation.RELATIVE_TO_SELF, 1.0f, Animation.RELATIVE_TO_SELF, 0.0f
       );
       }
       else{
        animation = new TranslateAnimation(
                Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f,
                Animation.RELATIVE_TO_SELF, -1.0f, Animation.RELATIVE_TO_SELF, 0.0f
            );
       }
       animation.setDuration(1000);
       set.addAnimation(animation);
       /*
       ScaleAnimation scale = new ScaleAnimation(-1, 1, -1, 1,
         ScaleAnimation.RELATIVE_TO_SELF, 1f,
         ScaleAnimation.RELATIVE_TO_SELF, 1f);
       set.addAnimation(scale);
       */
       panel.startAnimation(set);
    }

'IT 공부 > 안드로이드' 카테고리의 다른 글

파서(Get)  (1) 2012.02.25
Activity 화면창  (3) 2011.11.03
화면 변화  (1) 2011.11.02
자유곡선  (2) 2011.11.02
단어 정리  (2) 2011.08.12

+ Recent posts