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

      

  • 相关阅读:
    javascript04 引用类型
    apache httpd.conf 配置信息
    服务器集群原理
    网站优化常用技术
    php垃圾回收
    smarty2 简单应用 小留言板
    C# DataGridView 编辑单元格保存时防止单元格在编辑状态而产生空值
    C# 把字符串类型日期转换为日期类型
    C# Split方法操作取出文本文档txt文件里数据
    WinForm OR ASP.NET获取修改配置文件config的节点
  • 原文地址:https://www.cnblogs.com/andgoo/p/2224592.html
Copyright © 2011-2022 走看看