From 64c7a437ac94bc0a1025804507b59d453caecd2b Mon Sep 17 00:00:00 2001 From: Todd Kennedy Date: Wed, 23 Feb 2011 16:41:36 -0800 Subject: [PATCH] Properly clear "next" button de-bounce flags In some cases, the de-bounce flags were not being properly cleared. Namely, on the outgoing settings screen. We now consistently clear the flags to ensure the "next" button is always actionalble when it should be. bug 3425395 Change-Id: Ib8085fb96522158198d9f33a12effef8f65c0d19 --- .../activity/setup/AccountServerBaseFragment.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/com/android/email/activity/setup/AccountServerBaseFragment.java b/src/com/android/email/activity/setup/AccountServerBaseFragment.java index 0909457fd..3385d16af 100644 --- a/src/com/android/email/activity/setup/AccountServerBaseFragment.java +++ b/src/com/android/email/activity/setup/AccountServerBaseFragment.java @@ -60,7 +60,7 @@ public abstract class AccountServerBaseFragment extends Fragment // This is null in the setup wizard screens, and non-null in AccountSettings mode public Button mProceedButton; // This is used to debounce multiple clicks on the proceed button (which does async work) - public boolean mProceedButtonPressed; + private boolean mProceedButtonPressed; /*package*/ String mBaseScheme = "protocol"; /** @@ -130,8 +130,6 @@ public abstract class AccountServerBaseFragment extends Fragment if (getArguments() != null) { mSettingsMode = getArguments().getBoolean(BUNDLE_KEY_SETTINGS); } - - mProceedButtonPressed = false; } /** @@ -198,6 +196,7 @@ public abstract class AccountServerBaseFragment extends Fragment if (mProceedButton != null) { mProceedButton.setEnabled(enable); } + clearButtonBounce(); // TODO: This supports the phone UX activities and will be removed mCallback.onEnableProceedButtons(enable); @@ -214,6 +213,13 @@ public abstract class AccountServerBaseFragment extends Fragment new DuplicateCheckTask(accountId, checkHost, checkLogin, checkSettingsMode).execute(); } + /** + * Clears the "next" button de-bounce flags and allows the "next" button to activate. + */ + private void clearButtonBounce() { + mProceedButtonPressed = false; + } + private class DuplicateCheckTask extends AsyncTask { private final long mAccountId; @@ -249,7 +255,7 @@ public abstract class AccountServerBaseFragment extends Fragment // Otherwise, proceed with the save/check mCallback.onProceedNext(mCheckSettingsMode, fragment); } - mProceedButtonPressed = false; + clearButtonBounce(); } }