From 2f74755cf0c9ea766e1bd6774be27fd308ae1f96 Mon Sep 17 00:00:00 2001 From: kruland2607 Date: Wed, 8 Feb 2012 02:32:27 +0000 Subject: [PATCH] Second checkpoint commit of OpenRocketLoader to make it orientation change safe. Changed Main.java to register onclick listeners in java instead of the layout. Store the WarningSet in Application so it doesn't need to be serialized if the OpenRocketLoaderActivity is recreated during an orientation change. Fix the MissingMotorDialogFragment to only have the string and not the whole WarningSet. Finally completely rewrote the OpenRocketLoaderTask into a Fragment managing its own dialog. git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@400 180e2498-e6e9-4542-8430-84ac67f01cd8 --- .../android/util/ProgressDialogFragment.java | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 android/src/net/sf/openrocket/android/util/ProgressDialogFragment.java diff --git a/android/src/net/sf/openrocket/android/util/ProgressDialogFragment.java b/android/src/net/sf/openrocket/android/util/ProgressDialogFragment.java new file mode 100644 index 00000000..bb2c29e1 --- /dev/null +++ b/android/src/net/sf/openrocket/android/util/ProgressDialogFragment.java @@ -0,0 +1,35 @@ +package net.sf.openrocket.android.util; + +import android.app.ProgressDialog; +import android.os.Bundle; +import android.support.v4.app.DialogFragment; + +public class ProgressDialogFragment extends DialogFragment { + + public static ProgressDialogFragment newInstance(String title, String message) { + ProgressDialogFragment fragment = new ProgressDialogFragment(); + Bundle args = new Bundle(); + args.putString("title", title); + args.putString("message", message); + fragment.setArguments(args); + + return fragment; + } + + @Override + public ProgressDialog onCreateDialog(Bundle savedInstanceState) { + String title = getArguments().getString("title"); + String message = getArguments().getString("message"); + + ProgressDialog progressDialog = new ProgressDialog(getActivity()); + progressDialog.setTitle(title); + progressDialog.setMessage(message); + + progressDialog.setCancelable(false); + + progressDialog.show(); + + return progressDialog; + } + +} -- 2.47.2