Merge "Show "Creating account..." dialog during account creation" into jb-ub-mail
This commit is contained in:
commit
5bf0cef203
@ -577,6 +577,9 @@ as <xliff:g id="filename">%s</xliff:g>.</string>
|
||||
<!-- Appears on screen while system is checking outgoing server settings -->
|
||||
<string name="account_setup_check_settings_check_outgoing_msg">
|
||||
Validating smtp settings\u2026</string>
|
||||
<!-- Appears on screen while system is creating the account -->
|
||||
<string name="account_setup_creating_account_msg">
|
||||
Creating account\u2026</string>
|
||||
|
||||
<!-- Title of "Set up email" screen after success [CHAR LIMIT=45] -->
|
||||
<string name="account_setup_names_title">Account setup</string>
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user