动画

简介: 引用:http://www.oschina.net/code/snippet_12_1259 [图片] shot.jpg [代码] SplashScreen.java 01 public class SplashScreen extends Activit...

引用:http://www.oschina.net/code/snippet_12_1259

[图片] shot.jpg

img_6d262fbc1c08c8ec6f95e0ea26885510.jpg

[代码] SplashScreen.java

01 public class SplashScreen extends Activity {
02      
03     /**
04      * The thread to process splash screen events
05      */
06     private Thread mSplashThread;   
07  
08     /** Called when the activity is first created. */
09     @Override
10     public void onCreate(Bundle savedInstanceState) {
11         super.onCreate(savedInstanceState);
12  
13         // Splash screen view
14         setContentView(R.layout.splash);
15          
16         final SplashScreen sPlashScreen = this;  
17          
18         // The thread to wait for splash screen events
19         mSplashThread =  new Thread(){
20             @Override
21             public void run(){
22                 try {
23                     synchronized(this){
24                         // Wait given period of time or exit on touch
25                         wait(5000);
26                     }
27                 }
28                 catch(InterruptedException ex){                   
29                 }
30  
31                 finish();
32                  
33                 // Run next activity
34                 Intent intent = new Intent();
35                 intent.setClass(sPlashScreen, MainActivity.class);
36                 startActivity(intent);
37                 stop();                   
38             }
39         };
40          
41         mSplashThread.start();
42          
43     }
44          
45     /**
46      * Processes splash screen touch events
47      */
48     @Override
49     public boolean onTouchEvent(MotionEvent evt)
50     {
51         if(evt.getAction() == MotionEvent.ACTION_DOWN)
52         {
53             synchronized(mSplashThread){
54                 mSplashThread.notifyAll();
55             }
56         }
57         return true;
58     }
59      
60 }

[文件] AdvancedSplashDemo.zip ~ 1MB    下载(410)

相关文章
|
8月前
2D动画效果
2D动画效果
|
5月前
|
图形学 iOS开发
Unity——动效与缓动动画
Unity——动效与缓动动画
|
8月前
|
JavaScript
3D动画效果
3D动画效果
|
9月前
|
前端开发
CSS动画篇之404动画
CSS动画篇之404动画
103 0
|
11月前
|
存储 文件存储 云计算
不瞒了,我们和追光动画有一个《杨戬》!
不瞒了,我们和追光动画有一个《杨戬》!
130 0
An动画优化之遮罩层动画
An动画优化之遮罩层动画
175 0
An动画优化之遮罩层动画
|
图形学
unity动画之帧动画使用
使用unity实现lol寒冰帧动画
unity动画之帧动画使用
|
JavaScript 前端开发 开发者
动画-钩子函数实现小球半场动画|学习笔记
快速学习动画-钩子函数实现小球半场动画
107 0
动画-钩子函数实现小球半场动画|学习笔记
|
前端开发
动画
动画
98 0
|
前端开发
2、CSS动画——拳皇动画实现
2、CSS动画——拳皇动画实现
92 0
2、CSS动画——拳皇动画实现