Rework the loading workflow to be more natural and fix some nasty bugs. Make the...
[debian/openrocket] / android / src / net / sf / openrocket / android / ActivityHelpers.java
index bc6db510b01332351fa562fc696bc8318ef2bb41..02e920e4c24d9246179f578d62c6a28ff192e1de 100644 (file)
@@ -1,21 +1,45 @@
 package net.sf.openrocket.android;\r
 \r
-import net.sf.openrocket.android.motor.MotorHierarchicalBrowser;\r
+import net.sf.openrocket.android.motor.MotorBrowserActivity;\r
+import net.sf.openrocket.android.thrustcurve.TCQueryActivity;\r
 import android.app.Activity;\r
 import android.content.Intent;\r
+import android.net.Uri;\r
+import android.support.v4.app.FragmentActivity;\r
 \r
 public abstract class ActivityHelpers {\r
 \r
+       public static void goHome( Activity parent ) {\r
+               Intent i = new Intent(parent, Main.class);\r
+               i.addFlags( Intent.FLAG_ACTIVITY_CLEAR_TOP + Intent.FLAG_ACTIVITY_NEW_TASK );\r
+               parent.startActivity(i);\r
+       }\r
        \r
        public static void browseMotors( Activity parent ) {\r
-               Intent i = new Intent(parent, MotorHierarchicalBrowser.class);\r
+               Intent i = new Intent(parent, MotorBrowserActivity.class);\r
                parent.startActivity(i);\r
-               \r
        }\r
 \r
        public static void startPreferences( Activity parent ) {\r
                Intent intent = new Intent(parent, PreferencesActivity.class);\r
                parent.startActivity(intent);\r
+       }\r
+       \r
+       public static void downloadFromThrustcurve( Activity parent, int requestCode ) {\r
+               Intent i = new Intent(parent, TCQueryActivity.class);\r
+               parent.startActivityForResult(i, requestCode);\r
+       }\r
 \r
+       public static void donate( Activity parent ) {\r
+               String url = "http://sourceforge.net/donate/index.php?group_id=260357";\r
+               Intent intent = new Intent(Intent.ACTION_VIEW);\r
+               intent.setData( Uri.parse(url) );\r
+               parent.startActivity(intent);\r
+       }\r
+       \r
+       public static void showAbout( FragmentActivity parent ) {\r
+               AboutDialogFragment frag = AboutDialogFragment.newInstance();\r
+               frag.show(parent.getSupportFragmentManager(), "about");\r
        }\r
+\r
 }\r