Recent animation effects used in Android development.
public void OnClick (View arg0) {
TODO auto-generated method stubs
Switch (Arg0.getid ()) {
Case r.id.danru://Fade
Animationset aset=new Animationset (true);
Alphaanimation aa=new alphaanimation (1,0);
Aa.setduration (2000);
Aset.addanimation (AA);
Btn_danru.startanimation (Aset);
Break
Case r.id.yuanzhuan://Rotation effect
Animationset aset_2=new Animationset (true);
Rotateanimation aa_2=new rotateanimation (0,360,
animation.relative_to_self,0.5f,
animation.relative_to_self,0.5f);
Aa_2.setduration (2000);
Aset_2.addanimation (aa_2);
Btn_totate.startanimation (aset_2);
Break
Case r.id.suofang://Zoom Effect
Animationset aset_3=new Animationset (true);
Scaleanimation aa_3=new scaleanimation (1, 0.1f, 1, 0.1f,animation.relative_to_self,1f,animation.relative_to_self,1f );
Aa_3.setduration (2000);
Aset_3.addanimation (Aa_3);
Btn_suofang.startanimation (Aset_3);
Break
Case r.id.yidong://Move Effect
Animationset aset_4=new Animationset (true);
Translateanimation aa_4=new translateanimation (animation.relative_to_parent,0,animation.relative_to_parent, 1,
Animation.relative_to_parent, 0,animation.relative_to_parent, 1);
Aa_4.setduration (2000);
Aset_4.addanimation (Aa_4);
Btn_yidong.startanimation (Aset_4);
Break
}
}
Android four simple animations (fade, rotate, move, zoom effect)