80,349
社区成员
发帖
与我相关
我的任务
分享
public class LogoActivity extends Activity implements AnimationListener{
private ImageView logoImage = null;
private Animation animation = null;
private HashMap<String, Button> buttons = new HashMap<String, Button>();
private int index = 1;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_logo);
/*启动logo画面*/
logoImage = (ImageView)this.findViewById(R.id.logoID);
animation = AnimationUtils.loadAnimation(this, R.anim.logo_one);
logoImage.startAnimation(animation);
animation.setAnimationListener(this);
}
public void onAnimationEnd(Animation animation) {
switch (index){
case 1://第一个动画
{
index++;
animation = AnimationUtils.loadAnimation(this, R.anim.logo_one);
logoImage.startAnimation(animation);
animation.setAnimationListener(this);
}break;
case 2://第二个动画
{
index++;
animation = AnimationUtils.loadAnimation(this, R.anim.logo_two);
logoImage.startAnimation(animation);
animation.setAnimationListener(this);
}break;
case 3://第三个动画
{
index++;
animation = AnimationUtils.loadAnimation(this, R.anim.logo_three);
logoImage.startAnimation(animation);
animation.setAnimationListener(this);
}break;
case 4://第四个动画
{
index = 1;
animation = AnimationUtils.loadAnimation(this, R.anim.logo_four);
logoImage.startAnimation(animation);
animation.setAnimationListener(this);
}break;
default:break;
}
}
}
顺便讨教下,能不能再精简点,指导下一两点??谢谢。。。爱学习。。。