diff options
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 43b9244b6..73a8f1f8d 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -255,18 +255,20 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar private static final int MSG_SET_BIGRAM_PREDICTIONS = 7; private static final int MSG_PENDING_IMS_CALLBACK = 8; - private final int mDelayBeforeFadeoutLanguageOnSpacebar; - private final int mDelayUpdateSuggestions; - private final int mDelayUpdateShiftState; - private final int mDurationOfFadeoutLanguageOnSpacebar; - private final float mFinalFadeoutFactorOfLanguageOnSpacebar; - private final long mDoubleSpacesTurnIntoPeriodTimeout; - private final long mIgnoreSpecialKeyTimeout; + private int mDelayBeforeFadeoutLanguageOnSpacebar; + private int mDelayUpdateSuggestions; + private int mDelayUpdateShiftState; + private int mDurationOfFadeoutLanguageOnSpacebar; + private float mFinalFadeoutFactorOfLanguageOnSpacebar; + private long mDoubleSpacesTurnIntoPeriodTimeout; + private long mIgnoreSpecialKeyTimeout; public UIHandler(LatinIME outerInstance) { super(outerInstance); + } - final Resources res = outerInstance.getResources(); + public void onCreate() { + final Resources res = getOuterInstance().getResources(); mDelayBeforeFadeoutLanguageOnSpacebar = res.getInteger( R.integer.config_delay_before_fadeout_language_on_spacebar); mDelayUpdateSuggestions = @@ -507,6 +509,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar mSubtypeSwitcher = SubtypeSwitcher.getInstance(); mKeyboardSwitcher = KeyboardSwitcher.getInstance(); mVibrator = VibratorCompatWrapper.getInstance(this); + mHandler.onCreate(); DEBUG = LatinImeLogger.sDBG; final Resources res = getResources(); @@ -1333,13 +1336,17 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar break; case Keyboard.CODE_SHIFT: // Shift key is handled in onPress() when device has distinct multi-touch panel. - if (!distinctMultiTouch) + if (!distinctMultiTouch) { switcher.toggleShift(); + } + shouldStartKeyTypedTimer = false; break; case Keyboard.CODE_SWITCH_ALPHA_SYMBOL: // Symbol key is handled in onPress() when device has distinct multi-touch panel. - if (!distinctMultiTouch) + if (!distinctMultiTouch) { switcher.changeKeyboardMode(); + } + shouldStartKeyTypedTimer = false; break; case Keyboard.CODE_CANCEL: if (!isShowingOptionDialog()) { @@ -1405,6 +1412,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar mKeyboardSwitcher.onKey(Keyboard.CODE_DUMMY); mSpaceState = SPACE_STATE_NONE; mEnteredText = text; + mHandler.startKeyTypedTimer(); } @Override |