From a6b62a972714fb4cf63f18ed339394862a5dd712 Mon Sep 17 00:00:00 2001 From: kruland2607 Date: Tue, 3 Jan 2012 18:58:10 +0000 Subject: [PATCH] Added progress dialog when loading a file. Removed some default text from the view. Added safety net to launch the file browser when no file is specified. This last piece of functionality might be replaced with a dialog and better error handling in the future. git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@267 180e2498-e6e9-4542-8430-84ac67f01cd8 --- android/res/layout/openrocketviewer.xml | 2 +- .../android/rocket/OpenRocketViewer.java | 85 ++++++++++++++----- 2 files changed, 67 insertions(+), 20 deletions(-) diff --git a/android/res/layout/openrocketviewer.xml b/android/res/layout/openrocketviewer.xml index 1f024e0b..12634b90 100644 --- a/android/res/layout/openrocketviewer.xml +++ b/android/res/layout/openrocketviewer.xml @@ -8,7 +8,7 @@ android:id="@+id/heading" android:layout_width="fill_parent" android:layout_height="wrap_content" - android:text="Started" /> + android:text="" /> sims = new ArrayAdapter(this,android.R.layout.simple_list_item_1,rocket.getSimulations()) { @Override @@ -104,16 +147,20 @@ public class OpenRocketViewer extends Activity { i.putExtra("Simulation",(int)id); startActivityForResult(i, 1/*magic*/); } - + }); simulationList.setAdapter(sims); + if ( progress.isShowing() ) { + progress.dismiss(); + } + } - + @Override public boolean onCreateOptionsMenu(Menu menu) { - MenuInflater inflater = getMenuInflater(); - inflater.inflate(R.menu.rocket_viewer_option_menu, menu); + MenuInflater inflater = getMenuInflater(); + inflater.inflate(R.menu.rocket_viewer_option_menu, menu); return true; } @@ -134,9 +181,9 @@ public class OpenRocketViewer extends Activity { public void startMotorBrowser() { Log.d(TAG,"motorBrowserButton clicked"); - Intent i = new Intent(OpenRocketViewer.this, MotorHierarchicalBrowser.class); - startActivity(i); - } + Intent i = new Intent(OpenRocketViewer.this, MotorHierarchicalBrowser.class); + startActivity(i); + } -- 2.47.2