zoukankan      html  css  js  c++  java
  • Android应用的启动界面

    /**
     * @(#)Start.java
     * 
     * Copyright XXX.All rights reserved.
     * This software is the XXX system. 
     *
     * @Version: XXX
     * @JDK: jdk 1.6.0.XXX
     * @Module: Statefeedback
     */ 
     /*- 		History
     **********************************************
     *  ID      DATE           PERSON       REASON
     *  1     2011-10-25    WuChaoWen    Created
     **********************************************
     */
    
    package com.cnjmwl.scm;
    
    
    
    
    
    import android.app.Activity;
    import android.content.Intent;
    import android.os.Bundle;
    import android.os.Handler;
    import android.view.animation.AlphaAnimation;
    import android.widget.ImageView;
    
    /**
     * Class description goes here.
     *
     * @author WuChaoWen
     * @since 2011-10-25
     */
    public class Start extends Activity {
    	private ImageView splashImgView = null;
    	private int onShowTime = 2000;
    	private Class<?> nextUI = LoginActivity.class;
    	
    	@Override
    	protected void onCreate(Bundle savedInstanceState) {
    		
    		super.onCreate(savedInstanceState);
    		setContentView(R.layout.splash);
            splashImgView =(ImageView)findViewById(R.id.splashImageView);
    	}
    	
    	
    	@Override
    	protected void onStart() {
    		super.onStart();
    		int sIndex = 0;
    		showImg(0.2f,R.drawable.logo,300);
    		//showImg(0.5f,R.drawable.lurencun_logo_320dpi,onShowTime * ++sIndex);
    		showImg(0.2f,R.drawable.splash,onShowTime * ++sIndex);
    		new Handler().postDelayed(new Runnable(){
    			@Override
    			public void run() {
    				startActivity(new Intent(Start.this,nextUI));
    				Start.this.finish();
    			}
    		}, onShowTime * ++sIndex);
    		
    	}
    	
    	
    	private void showImg(final float startAlpha,final int drawableId,int delay){
        	new Handler().postDelayed(new Runnable(){
    			@Override
    			public void run() {
    				splashImgView.setImageResource(drawableId);
    				AlphaAnimation animation = new AlphaAnimation(startAlpha, 1.0f);
    				animation.setDuration(1000);
    				splashImgView.startAnimation(animation);
    			}
    		},delay);
    	}
    }
    

      

  • 相关阅读:
    包含游标、数组的例子
    团队开发的注意点
    养成逻辑的习惯
    C# DEV 右键出现菜单
    C#中ToString数据类型格式大全 千分符(转)
    Oracle系统查询的语句
    PLSQLDevelop 查询当前未完成的会话
    Oracle 异常工作中出现的
    Oracle 返回结果集 sys_refcursor
    DevExpress.XtraEditors.TextEdit,设定为必须number类型的。
  • 原文地址:https://www.cnblogs.com/andgoo/p/2224592.html
Copyright © 2011-2022 走看看