aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2013-05-15 03:54:15 -0700
committerThe Android Automerger <android-build@android.com>2013-05-15 07:58:18 -0700
commit25f0c8089eecfcded7f41c66453bd874ba92219a (patch)
tree58a138213249a76b84884efb959179a61dd2e9d9 /java/src
parentd59c1f8324d568fa05a0ba660c602357b8f68958 (diff)
downloadlatinime-25f0c8089eecfcded7f41c66453bd874ba92219a.tar.gz
latinime-25f0c8089eecfcded7f41c66453bd874ba92219a.tar.xz
latinime-25f0c8089eecfcded7f41c66453bd874ba92219a.zip
am 96a9f357: Merge "Fix unintentional setup step advance in orientation change"
* commit '96a9f357c7e2a059687926cd7cd52ac5d06bc65e': Fix unintentional setup step advance in orientation change
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/setup/SetupWizardActivity.java20
1 files changed, 16 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/latin/setup/SetupWizardActivity.java b/java/src/com/android/inputmethod/latin/setup/SetupWizardActivity.java
index b6cdafb9e..78a6478c6 100644
--- a/java/src/com/android/inputmethod/latin/setup/SetupWizardActivity.java
+++ b/java/src/com/android/inputmethod/latin/setup/SetupWizardActivity.java
@@ -61,6 +61,7 @@ public final class SetupWizardActivity extends Activity implements View.OnClickL
private SetupStepGroup mSetupStepGroup;
private static final String STATE_STEP = "step";
private int mStepNumber;
+ private boolean mNeedsToAdjustStepNumberToSystemState;
private static final int STEP_WELCOME = 0;
private static final int STEP_1 = 1;
private static final int STEP_2 = 2;
@@ -159,9 +160,7 @@ public final class SetupWizardActivity extends Activity implements View.OnClickL
step2.setAction(new Runnable() {
@Override
public void run() {
- // Invoke input method picker.
- RichInputMethodManager.getInstance().getInputMethodManager()
- .showInputMethodPicker();
+ invokeInputMethodPicker();
}
});
mSetupStepGroup.addStep(step2);
@@ -245,6 +244,7 @@ public final class SetupWizardActivity extends Activity implements View.OnClickL
| Intent.FLAG_ACTIVITY_SINGLE_TOP
| Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
+ mNeedsToAdjustStepNumberToSystemState = true;
}
private void invokeSettingsOfThisIme() {
@@ -260,6 +260,14 @@ public final class SetupWizardActivity extends Activity implements View.OnClickL
intent.setAction(Settings.ACTION_INPUT_METHOD_SETTINGS);
intent.addCategory(Intent.CATEGORY_DEFAULT);
startActivity(intent);
+ mNeedsToAdjustStepNumberToSystemState = true;
+ }
+
+ void invokeInputMethodPicker() {
+ // Invoke input method picker.
+ RichInputMethodManager.getInstance().getInputMethodManager()
+ .showInputMethodPicker();
+ mNeedsToAdjustStepNumberToSystemState = true;
}
void invokeSubtypeEnablerOfThisIme() {
@@ -313,6 +321,9 @@ public final class SetupWizardActivity extends Activity implements View.OnClickL
@Override
protected void onRestart() {
super.onRestart();
+ // Probably the setup wizard has been invoked from "Recent" menu. The setup step number
+ // needs to be adjusted to system state, because the state (IME is enabled and/or current)
+ // may have been changed.
if (isInSetupSteps(mStepNumber)) {
mStepNumber = determineSetupStepNumber();
}
@@ -371,7 +382,8 @@ public final class SetupWizardActivity extends Activity implements View.OnClickL
@Override
public void onWindowFocusChanged(final boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
- if (hasFocus && isInSetupSteps(mStepNumber)) {
+ if (hasFocus && mNeedsToAdjustStepNumberToSystemState) {
+ mNeedsToAdjustStepNumberToSystemState = false;
mStepNumber = determineSetupStepNumber();
updateSetupStepView();
}