package com.example.mobilesafe;

import android.app.Activity;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Bundle;
import android.view.Menu;
import android.view.Window;
import android.widget.RelativeLayout;
import android.widget.TextView;


/**
 * @author Administrator
 *@company Newbie
 *@date 2016-8-15
 *@des 初始化Splash界面。
 */
public class SplashActivity extends Activity {

	
	 
	private TextView splash_version_name;
	private RelativeLayout rl_splash_root;
	private String versionName;

	@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        
        initView();
        
        initDate();
        
        initEvent();
    }

	/**
	 * 初始化splash界面
	 */
    private void initView() {
    	// TODO Auto-generated method stub
         setContentView(R.layout.activity_splash);
         rl_splash_root = (RelativeLayout) findViewById(R.id.rl_splash_root);
         splash_version_name = (TextView) findViewById(R.id.tv_splash_version_name);
    }

    /**
     * 填充splash界面初始化数据
     */
	private void initDate() {
		// TODO Auto-generated method stub
		try {
			PackageInfo packageInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
			versionName = packageInfo.versionName;
			splash_version_name.setText(versionName);
		} catch (NameNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	private void initEvent() {
		// TODO Auto-generated method stub
		
	}

	@Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

     
}

@@ -59,51 +59,8 @@
 ty;%0A
-import android.content.pm.ApplicationInfo;%0A
 impo
@@ -94,16 +94,16 @@
 geInfo;%0A
+
 import a
@@ -238,16 +238,240 @@
 Window;%0A
+import android.view.animation.AlphaAnimation;%0Aimport android.view.animation.Animation;%0Aimport android.view.animation.AnimationSet;%0Aimport android.view.animation.RotateAnimation;%0Aimport android.view.animation.ScaleAnimation;%0A
 import a
@@ -783,16 +783,53 @@
 ionName;
+%0A%09private AnimationSet mAnimationSet;
 %0A%0A%09@Over
@@ -990,32 +990,49 @@
 ITLE);%0A        %0A
+        //%E5%88%9D%E5%A7%8B%E5%8C%96%E7%95%8C%E9%9D%A2%E3%80%82%0A
         initView
@@ -1035,32 +1035,42 @@
 View();%0A        
+//%E6%98%BE%E7%A4%BA%E6%95%B0%E6%8D%AE%E5%88%B0%E7%95%8C%E9%9D%A2%E3%80%82
 %0A        initDat
@@ -1104,20 +1104,821 @@
 vent();%0A
-
     
+    %0A        //%E8%AE%BE%E7%BD%AE%E5%8A%A8%E7%94%BB%0A        initAnimation();%0A    %7D%0A%0A%09private void initAnimation() %7B%0A%09%09RotateAnimation ra = new RotateAnimation(0.0f, 360.0f, %0A%09%09%09%09%09%09%09%09%09%09%09%09Animation.RELATIVE_TO_SELF, 0.5f, %0A%09%09%09%09%09%09%09%09%09%09%09%09Animation.RELATIVE_TO_SELF, 0.5f);%0A%09%09ra.setDuration(2000);%0A%09%09ra.setFillAfter(true);%0A%09%09%0A%09%09ScaleAnimation sa = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, %0A%09%09%09%09%09%09%09%09%09%09%09%09Animation.RELATIVE_TO_SELF, 0.5f, %0A%09%09%09%09%09%09%09%09%09%09%09%09Animation.RELATIVE_TO_SELF, 0.5f);%0A%09%09sa.setDuration(2000);%0A%09%09sa.setFillAfter(true);%0A%09%09%0A%09%09AlphaAnimation aa=new AlphaAnimation(0.0f, 1.0f);%0A%09%09aa.setDuration(2000);%0A%09%09aa.setFillAfter(true);%0A%09%09%0A%09%09%0A%09%09mAnimationSet = new AnimationSet(false);%0A%09%09mAnimationSet.addAnimation(sa);%0A%09%09mAnimationSet.addAnimation(ra);%0A%09%09mAnimationSet.addAnimation(aa);%0A%09%09rl_splash_root.startAnimation(mAnimationSet);%0A%09
 %7D%0A%0A%09/**%0A

设置splash相关动画。