]> git.gag.com Git - debian/openrocket/commitdiff
Get rid of timed splash and display a better welcome screen.
authorkruland2607 <kruland2607@180e2498-e6e9-4542-8430-84ac67f01cd8>
Mon, 9 Jan 2012 19:00:19 +0000 (19:00 +0000)
committerkruland2607 <kruland2607@180e2498-e6e9-4542-8430-84ac67f01cd8>
Mon, 9 Jan 2012 19:00:19 +0000 (19:00 +0000)
git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@323 180e2498-e6e9-4542-8430-84ac67f01cd8

android/AndroidManifest.xml
android/res/drawable/rocketglobe.png [new file with mode: 0644]
android/res/layout-land/main.xml [new file with mode: 0644]
android/res/layout/main.xml
android/src/net/sf/openrocket/android/Main.java

index e660bb6f7a4237cf34f1c0a6226a69f40977d2ae..2e6848374ba14bb4616471331817ea8b3c0570ea 100644 (file)
@@ -1,62 +1,80 @@
 <?xml version="1.0" encoding="utf-8"?>\r
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"\r
-       package="net.sf.openrocket" android:versionCode="1"\r
-       android:versionName="1.0">\r
+    package="net.sf.openrocket"\r
+    android:versionCode="1"\r
+    android:versionName="1.0" >\r
 \r
-       <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="8" />\r
+    <uses-sdk\r
+        android:minSdkVersion="8"\r
+        android:targetSdkVersion="8" />\r
 \r
-       <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />\r
-       <uses-permission android:name="android.permission.INTERNET" />\r
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />\r
+    <uses-permission android:name="android.permission.INTERNET" />\r
 \r
-       <application android:debuggable="true" android:icon="@drawable/or_launcher"\r
-               android:killAfterRestore="true" android:label="@string/app_name"\r
-               android:name=".android.Application">\r
-               <activity android:name=".android.Main">\r
-                       <intent-filter>\r
-                               <action android:name="android.intent.action.MAIN" />\r
+    <application\r
+        android:debuggable="true"\r
+        android:icon="@drawable/or_launcher"\r
+        android:killAfterRestore="true"\r
+        android:label="@string/app_name"\r
+        android:name=".android.Application" >\r
+        <activity\r
+            android:name=".android.Main"\r
+            android:theme="@android:style/Theme.Black.NoTitleBar" >\r
+            <intent-filter >\r
+                <action android:name="android.intent.action.MAIN" />\r
 \r
-                               <category android:name="android.intent.category.LAUNCHER" />\r
-                       </intent-filter>\r
-               </activity>\r
-               <activity android:label="@string/app_name" android:name=".android.rocket.OpenRocketViewer">\r
+                <category android:name="android.intent.category.LAUNCHER" />\r
+            </intent-filter>\r
+        </activity>\r
+        <activity\r
+            android:label="@string/app_name"\r
+            android:name=".android.rocket.OpenRocketViewer" >\r
 \r
-                       <!-- I don't understand why I need to have two different intent filters. \r
+            <!--\r
+                 I don't understand why I need to have two different intent filters. \r
                                Combining the <data> elements into a single field did not result in a working \r
                                application. The first intent-filter (with mimeType wildcard) convinces the \r
                                file browser to associate the correct launcher icon. the second intent-filter \r
-                               is actually invoked when a file is selected. -->\r
-                       <intent-filter>\r
-                               <action android:name="android.intent.action.VIEW" />\r
-\r
-                               <category android:name="android.intent.category.DEFAULT" />\r
-\r
-                               <data android:host="*" android:mimeType="*/*"\r
-                                       android:pathPattern=".*\\.ork" android:scheme="file" />\r
-                       </intent-filter>\r
-                       <intent-filter>\r
-                               <action android:name="android.intent.action.VIEW" />\r
-\r
-                               <category android:name="android.intent.category.DEFAULT" />\r
-\r
-                               <data android:host="*" android:pathPattern=".*\\.ork"\r
-                                       android:scheme="file" />\r
-                       </intent-filter>\r
-               </activity>\r
-               <activity android:name=".android.PreferencesActivity">\r
-                       <intent-filter>\r
-                               <action android:name="net.sf.openrocket.android.PreferencesActivity" />\r
-\r
-                               <category android:name="android.intent.category.PREFERENCE" />\r
-                       </intent-filter>\r
-               </activity>\r
-               <activity android:label="@string/MotorListTitle"\r
-                       android:name=".android.motor.MotorHierarchicalBrowser" />\r
-               <activity android:name=".android.motor.MotorDetails" />\r
-               <activity android:label="@string/MotorListTitle"\r
-                       android:name=".android.thrustcurve.TCQueryActivity" />\r
-               <activity android:name=".android.simulation.SimulationViewer" />\r
-               <activity android:name=".android.simulation.GraphicalActivity" />\r
-\r
-       </application>\r
+                               is actually invoked when a file is selected.\r\r
+            -->\r
+            <intent-filter >\r
+                <action android:name="android.intent.action.VIEW" />\r
+\r
+                <category android:name="android.intent.category.DEFAULT" />\r
+\r
+                <data\r
+                    android:host="*"\r
+                    android:mimeType="*/*"\r
+                    android:pathPattern=".*\\.ork"\r
+                    android:scheme="file" />\r
+            </intent-filter>\r
+            <intent-filter >\r
+                <action android:name="android.intent.action.VIEW" />\r
+\r
+                <category android:name="android.intent.category.DEFAULT" />\r
+\r
+                <data\r
+                    android:host="*"\r
+                    android:pathPattern=".*\\.ork"\r
+                    android:scheme="file" />\r
+            </intent-filter>\r
+        </activity>\r
+        <activity android:name=".android.PreferencesActivity" >\r
+            <intent-filter >\r
+                <action android:name="net.sf.openrocket.android.PreferencesActivity" />\r
+\r
+                <category android:name="android.intent.category.PREFERENCE" />\r
+            </intent-filter>\r
+        </activity>\r
+        <activity\r
+            android:label="@string/MotorListTitle"\r
+            android:name=".android.motor.MotorHierarchicalBrowser" />\r
+        <activity android:name=".android.motor.MotorDetails" />\r
+        <activity\r
+            android:label="@string/MotorListTitle"\r
+            android:name=".android.thrustcurve.TCQueryActivity" />\r
+        <activity android:name=".android.simulation.SimulationViewer" />\r
+        <activity android:name=".android.simulation.GraphicalActivity" />\r
+    </application>\r
 \r
 </manifest>
\ No newline at end of file
diff --git a/android/res/drawable/rocketglobe.png b/android/res/drawable/rocketglobe.png
new file mode 100644 (file)
index 0000000..8141775
Binary files /dev/null and b/android/res/drawable/rocketglobe.png differ
diff --git a/android/res/layout-land/main.xml b/android/res/layout-land/main.xml
new file mode 100644 (file)
index 0000000..0d682a0
--- /dev/null
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"\r
+    android:layout_width="fill_parent"\r
+    android:layout_height="fill_parent"\r
+    android:orientation="horizontal" >\r
+\r
+    <ImageView\r
+        android:layout_width="wrap_content"\r
+        android:layout_height="match_parent"\r
+        android:src="@drawable/rocketglobe" />\r
+\r
+    <LinearLayout\r
+        android:layout_width="wrap_content"\r
+        android:layout_height="match_parent"\r
+        android:orientation="vertical" >\r
+\r\r
+        <TextView\r
+            android:layout_width="match_parent"\r
+            android:layout_height="wrap_content"\r
+            android:layout_weight="1"\r
+            android:gravity="center_horizontal"\r
+            android:text="Welcome to OpenRocket" />\r
+\r\r\r\r\r
+        <LinearLayout\r
+            android:layout_width="match_parent"\r
+            android:layout_height="wrap_content"\r
+            android:layout_gravity="bottom"\r
+            android:orientation="horizontal" >\r
+\r\r
+            <Button\r
+                android:layout_width="wrap_content"\r
+                android:layout_height="wrap_content"\r
+                android:layout_gravity="center_vertical"\r
+                android:onClick="pickOrkFiles"\r
+                android:text="View ork file" />\r
+\r\r\r\r\r\r\r\r
+            <Button\r
+                android:layout_width="wrap_content"\r
+                android:layout_height="wrap_content"\r
+                android:layout_gravity="center_vertical"\r
+                android:onClick="browseMotors"\r
+                android:text="View motors" />\r
+\r
+        </LinearLayout>\r
+    </LinearLayout>\r
+\r
+</LinearLayout>
\ No newline at end of file
index 53b32ec69d46e5f64243071e018443a82bd98fd0..f99a4fdd91fda468a17058da1f68cdc3ba0661cd 100644 (file)
@@ -1,31 +1,40 @@
 <?xml version="1.0" encoding="utf-8"?>\r
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"\r
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"\r
     android:layout_width="fill_parent"\r
     android:layout_height="fill_parent"\r
     android:orientation="vertical" >\r
 \r
-    <ImageView\r
-        android:id="@+id/splashscreen"\r
-        android:layout_width="wrap_content"\r
-        android:layout_height="fill_parent"\r
-        android:layout_gravity="center"\r
-        android:src="@drawable/splashscreen" />\r
-\r
     <TextView\r
+        android:id="@+id/openrocket"\r
         android:layout_width="fill_parent"\r
         android:layout_height="wrap_content"\r
+        android:gravity="center_horizontal"\r
         android:text="Welcome to OpenRocket" />\r
 \r
-    <Button\r
+    <ImageView\r
+        android:id="@+id/rocketglobe"\r
         android:layout_width="fill_parent"\r
         android:layout_height="wrap_content"\r
-        android:onClick="pickOrkFiles"\r
-        android:text="View ork file" />\r
+        android:layout_below="@id/openrocket"\r
+        android:src="@drawable/rocketglobe" />\r
 \r
-    <Button\r
+    <LinearLayout\r
         android:layout_width="fill_parent"\r
         android:layout_height="wrap_content"\r
-        android:onClick="browseMotors"\r
-        android:text="View motors" />\r
+        android:layout_below="@id/rocketglobe"\r
+        android:gravity="center_horizontal" >\r
+\r
+        <Button\r
+            android:layout_width="wrap_content"\r
+            android:layout_height="wrap_content"\r
+            android:onClick="pickOrkFiles"\r
+            android:text="View ork file" />\r
+\r
+        <Button\r
+            android:layout_width="wrap_content"\r
+            android:layout_height="wrap_content"\r
+            android:onClick="browseMotors"\r
+            android:text="View motors" />\r
+    </LinearLayout>\r
 \r
-</LinearLayout>
\ No newline at end of file
+</RelativeLayout>
\ No newline at end of file
index 347115c628be8cbb27c074f05992b283291d6f25..bd80c9fd050cc0fe921e87732b2ad79fa53501c2 100644 (file)
@@ -6,47 +6,18 @@ import android.app.Activity;
 import android.content.Intent;\r
 import android.net.Uri;\r
 import android.os.Bundle;\r
-import android.os.Handler;\r
-import android.os.Message;\r
 import android.view.View;\r
-import android.widget.ImageView;\r
+import android.view.Window;\r
 \r
 public class Main extends Activity {\r
 \r
        private static final int PICK_ORK_FILE_RESULT = 1;\r
 \r
-       private static final int STOPSPLASH = 0;\r
-       //time in milliseconds\r
-       private static final long SPLASHTIME = 3000;\r
-\r
-       private ImageView splash;\r
-\r
-       //handler for splash screen\r
-       private Handler splashHandler = new Handler() {\r
-               /* (non-Javadoc)\r
-                * @see android.os.Handler#handleMessage(android.os.Message)\r
-                */\r
-               @Override\r
-               public void handleMessage(Message msg) {\r
-                       switch (msg.what) {\r
-                       case STOPSPLASH:\r
-                               //remove SplashScreen from view\r
-                               splash.setVisibility(View.GONE);\r
-                               break;\r
-                       }\r
-                       super.handleMessage(msg);\r
-               }\r
-       };\r
-\r
        /** Called when the activity is first created. */\r
        @Override\r
        public void onCreate(Bundle icicle) {\r
                super.onCreate(icicle);\r
                setContentView(R.layout.main);\r
-               splash = (ImageView) findViewById(R.id.splashscreen);\r
-               Message msg = new Message();\r
-               msg.what = STOPSPLASH;\r
-               splashHandler.sendMessageDelayed(msg, SPLASHTIME);\r
        }\r
 \r
        /* (non-Javadoc)\r