From 6eac1c9f1c15c8a9440fbf4c1854958c054b912b Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Mon, 3 Sep 2012 16:44:33 -0700 Subject: [PATCH] Show "Creating account..." dialog during account creation Bug: 7100373 Change-Id: Ic86d8b8c8fafe628a69e867d93719bb986c7c583 --- res/values/strings.xml | 3 +++ .../activity/setup/AccountSetupOptions.java | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/res/values/strings.xml b/res/values/strings.xml index 20b0b3c71..52670b219 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -577,6 +577,9 @@ as %s. Validating smtp settings\u2026 + + + Creating account\u2026 Account setup diff --git a/src/com/android/email/activity/setup/AccountSetupOptions.java b/src/com/android/email/activity/setup/AccountSetupOptions.java index d2858bf73..6a8ca3536 100644 --- a/src/com/android/email/activity/setup/AccountSetupOptions.java +++ b/src/com/android/email/activity/setup/AccountSetupOptions.java @@ -24,6 +24,7 @@ import android.accounts.AuthenticatorException; import android.accounts.OperationCanceledException; import android.app.Activity; import android.app.AlertDialog; +import android.app.ProgressDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; @@ -66,6 +67,8 @@ public class AccountSetupOptions extends AccountSetupActivity implements OnClick private boolean mDonePressed = false; private EmailServiceInfo mServiceInfo; + private ProgressDialog mCreateAccountDialog; + public static final int REQUEST_CODE_ACCEPT_POLICIES = 1; /** Default sync window for new EAS accounts */ @@ -153,6 +156,13 @@ public class AccountSetupOptions extends AccountSetupActivity implements OnClick @Override public void finish() { + + // If we're showing "Creating account...", dismiss it + if (mCreateAccountDialog != null) { + mCreateAccountDialog.dismiss(); + mCreateAccountDialog = null; + } + // If the account manager initiated the creation, and success was not reported, // then we assume that we're giving up (for any reason) - report failure. AccountAuthenticatorResponse authenticatorResponse = @@ -246,6 +256,12 @@ public class AccountSetupOptions extends AccountSetupActivity implements OnClick final boolean calendar2 = calendar; final boolean contacts2 = contacts; + /// Show "Creating account..." dialog + mCreateAccountDialog = new ProgressDialog(this); + mCreateAccountDialog.setIndeterminate(true); + mCreateAccountDialog.setMessage(getString(R.string.account_setup_creating_account_msg)); + mCreateAccountDialog.show(); + Utility.runAsync(new Runnable() { @Override public void run() {