zoukankan      html  css  js  c++  java
  • Android 应用启动动画代码

    requestWindowFeature(Window.FEATURE_NO_TITLE);//设置无标题
    setContentView(R.layout.activity_main);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);//设置全屏
    ImageView welcomeImg = (ImageView) findViewById(R.id.iv);//启动时显示的图片
    AlphaAnimation anima = new AlphaAnimation(0.3f, 1.0f);//创建一个透明度从0.3 慢慢到不透明的原图的动画效果
    anima.setDuration(3000);// 设置动画显示时间
    welcomeImg.startAnimation(anima);//设置启动时图片的动画
    anima.setAnimationListener(new AnimationImpl());//设置动画监听
     private class AnimationImpl implements AnimationListener {//动画监听

      @Override   public void onAnimationStart(Animation animation) { //   welcomeImg.setBackgroundResource(R.drawable.ic_launcher);   }

      @Override   public void onAnimationEnd(Animation animation) {    Intent intent = new Intent(MainActivity.this, OtherActivity.class);

       startActivity(intent);    finish();   }

      @Override   public void onAnimationRepeat(Animation animation) {

      }  }

     


     

  • 相关阅读:
    MySQL分库分表环境下全局ID生成方案
    centos添加php及mysql环境变量
    shell中的常用通配符,字符类
    centos7 安装xinetd,telnet
    centos7 systemctl一些用法
    ps命令
    nginx与php-fpm通信的两种方式
    nginx常用功能
    MySQL安装
    MySql与MariaDB由来与历程
  • 原文地址:https://www.cnblogs.com/yjbjingcha/p/6918110.html
Copyright © 2011-2022 走看看