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

      

  • 相关阅读:
    Java 的类加载顺序
    单链表之一元多项式求和C++实现
    顺序线性表之大整数求和C++实现
    线性表之单链表C++实现
    NOIP 2009 潜伏者
    JDOJ 2782: 和之和
    浅谈前、中、后缀表达式
    CF13B Letter A
    洛谷 P5015 标题统计
    NOIP 2013 转圈游戏
  • 原文地址:https://www.cnblogs.com/andgoo/p/2224592.html
Copyright © 2011-2022 走看看