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);
}