diff options
author | 2009-07-21 15:47:11 -0700 | |
---|---|---|
committer | 2009-08-13 17:21:54 -0700 | |
commit | b19668cfc17ad30afcc3c8c0407d47238ce1a90d (patch) | |
tree | 2740edffbf98449b8ee024132d0ba811ff049912 /src/com/android/inputmethod/latin/LatinIME.java | |
parent | 34386e698876c0f29b2d5b54b44db1e32b562c47 (diff) | |
download | latinime-b19668cfc17ad30afcc3c8c0407d47238ce1a90d.tar.gz latinime-b19668cfc17ad30afcc3c8c0407d47238ce1a90d.tar.xz latinime-b19668cfc17ad30afcc3c8c0407d47238ce1a90d.zip |
Auto-switch back from symbols keyboard on space.
Also fix bug 1904029: Rotating keyboard while texting causes words to be deleted.
Diffstat (limited to 'src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | src/com/android/inputmethod/latin/LatinIME.java | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/com/android/inputmethod/latin/LatinIME.java b/src/com/android/inputmethod/latin/LatinIME.java index 4b4cafedc..eec78a167 100644 --- a/src/com/android/inputmethod/latin/LatinIME.java +++ b/src/com/android/inputmethod/latin/LatinIME.java @@ -115,6 +115,8 @@ public class LatinIME extends InputMethodService private boolean mQuickFixes; private boolean mShowSuggestions; private int mCorrectionMode; + private int mOrientation; + // Indicates whether the suggestion strip is to be on in landscape private boolean mJustAccepted; private CharSequence mJustRevertedSeparator; @@ -159,10 +161,12 @@ public class LatinIME extends InputMethodService super.onCreate(); //setStatusIcon(R.drawable.ime_qwerty); mKeyboardSwitcher = new KeyboardSwitcher(this); - initSuggest(getResources().getConfiguration().locale.toString()); - + final Configuration conf = getResources().getConfiguration(); + initSuggest(conf.locale.toString()); + mOrientation = conf.orientation; + mVibrateDuration = getResources().getInteger(R.integer.vibrate_duration_ms); - + // register to receive ringer mode changes for silent mode IntentFilter filter = new IntentFilter(AudioManager.RINGER_MODE_CHANGED_ACTION); registerReceiver(mReceiver, filter); @@ -191,9 +195,14 @@ public class LatinIME extends InputMethodService if (!TextUtils.equals(conf.locale.toString(), mLocale)) { initSuggest(conf.locale.toString()); } + // If orientation changed while predicting, commit the change + if (conf.orientation != mOrientation) { + commitTyped(getCurrentInputConnection()); + mOrientation = conf.orientation; + } super.onConfigurationChanged(conf); } - + @Override public View onCreateInputView() { mInputView = (LatinKeyboardView) getLayoutInflater().inflate( @@ -575,6 +584,9 @@ public class LatinIME extends InputMethodService // Cancel the just reverted state mJustRevertedSeparator = null; } + if (mKeyboardSwitcher.onKey(primaryCode)) { + changeKeyboardMode(); + } } public void onText(CharSequence text) { |