Permalink
Browse files

Add splash screen

  • Loading branch information...
1 parent ba50a11 commit d8782ee78082d8d87786781915b6b6b3766afcf1 @axelson axelson committed Dec 9, 2011
View
@@ -1,22 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="org.hicapacity.techhui"
- android:versionCode="2"
- android:versionName="0.3">
- <uses-sdk android:minSdkVersion="8" />
- <uses-permission android:name="android.permission.INTERNET" />
+ package="org.hicapacity.techhui" android:versionCode="2"
+ android:versionName="0.3">
+ <uses-sdk android:minSdkVersion="8" />
+ <uses-permission android:name="android.permission.INTERNET" />
- <application android:icon="@drawable/icon" android:label="@string/app_name">
- <activity android:name=".TechHuiActivity"
- android:label="@string/app_name">
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
- <activity android:name=".ConferenceActivity"></activity>
- <activity android:name=".CommunityActivity"></activity>
- <activity android:name=".WebScheduleActivity"></activity>
+ <application android:icon="@drawable/icon" android:label="@string/app_name">
+ <activity android:name=".TechHuiActivity" android:label="@string/app_name">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.DEFAULT" />
+ </intent-filter>
+ </activity>
+ <activity android:name=".ConferenceActivity"></activity>
+ <activity android:name=".CommunityActivity"></activity>
+ <activity android:name=".WebScheduleActivity"></activity>
+ <activity android:name=".NewSplashScreen">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
- </application>
+ </application>
</manifest>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:padding="5dp">
+ <ImageView
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:id="@+id/SplashImageView"
+ android:scaleType="fitXY"
+ android:src="@drawable/splash"
+ >
+ </ImageView>
+</LinearLayout>
@@ -0,0 +1,70 @@
+package org.hicapacity.techhui;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.MotionEvent;
+import android.widget.ImageView;
+import android.widget.ImageView.ScaleType;
+
+public class NewSplashScreen extends Activity {
+
+ /**
+ * The thread to process splash screen events
+ */
+ private Thread mSplashThread;
+
+ /** Called when the activity is first created. */
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ // Splash screen view
+ setContentView(R.layout.splash);
+
+ ImageView timeView = (ImageView) this.findViewById(R.id.SplashImageView);
+ timeView.setScaleType(ScaleType.FIT_XY);
+
+ final NewSplashScreen sPlashScreen = this;
+
+// imgview.setScaleType(ScaleType.FIT_XY);
+
+ // The thread to wait for splash screen events
+ mSplashThread = new Thread() {
+ @Override
+ public void run() {
+ try {
+ synchronized (this) {
+ // Wait given period of time or exit on touch
+ wait(1000);
+ }
+ }
+ catch (InterruptedException ex) {
+ }
+
+ finish();
+
+ // Run next activity
+ Intent intent = new Intent();
+ intent.setClass(sPlashScreen, TechHuiActivity.class);
+ startActivity(intent);
+ stop();
+ }
+ };
+
+ mSplashThread.start();
+ }
+
+ /**
+ * Processes splash screen touch events
+ */
+ @Override
+ public boolean onTouchEvent(MotionEvent evt) {
+ if (evt.getAction() == MotionEvent.ACTION_DOWN) {
+ synchronized (mSplashThread) {
+ mSplashThread.notifyAll();
+ }
+ }
+ return true;
+ }
+}

0 comments on commit d8782ee

Please sign in to comment.