diff options
author | 2012-07-23 14:59:19 +0900 | |
---|---|---|
committer | 2012-07-25 16:11:53 +0900 | |
commit | 0657b9698a110f8e895448d829478982ce37b6d1 (patch) | |
tree | 0bc65a836e06817696f49b0a1ad01af850d6abc9 /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | 42208100d87769006d0448db604a2efa1048b5d3 (diff) | |
download | latinime-0657b9698a110f8e895448d829478982ce37b6d1.tar.gz latinime-0657b9698a110f8e895448d829478982ce37b6d1.tar.xz latinime-0657b9698a110f8e895448d829478982ce37b6d1.zip |
Update gesture mode state when dictionary gets available
Bug: 6860204
Change-Id: I840b7bf1983ab92fa4e0b180129176539e96409f
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 05dcee50b..7d79886fa 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -430,7 +430,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen @Override public void onUpdateMainDictionaryAvailability(boolean isMainDictionaryAvailable) { mIsMainDictionaryAvailable = isMainDictionaryAvailable; - // TODO: Update gesture input enable state. + updateKeyboardViewGestureHandlingModeByMainDictionaryAvailability(); } private void initSuggest() { @@ -681,6 +681,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } switcher.loadKeyboard(editorInfo, mCurrentSettings); + updateKeyboardViewGestureHandlingModeByMainDictionaryAvailability(); if (mSuggestionStripView != null) mSuggestionStripView.clear(); @@ -2052,18 +2053,28 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen public void onRefreshKeyboard() { // When the device locale is changed in SetupWizard etc., this method may get called via // onConfigurationChanged before SoftInputWindow is shown. + initSuggest(); + loadSettings(); if (mKeyboardSwitcher.getKeyboardView() != null) { // Reload keyboard because the current language has been changed. mKeyboardSwitcher.loadKeyboard(getCurrentInputEditorInfo(), mCurrentSettings); + updateKeyboardViewGestureHandlingModeByMainDictionaryAvailability(); } - initSuggest(); - loadSettings(); // Since we just changed languages, we should re-evaluate suggestions with whatever word // we are currently composing. If we are not composing anything, we may want to display // predictions or punctuation signs (which is done by the updateSuggestionStrip anyway). mHandler.postUpdateSuggestionStrip(); } + private void updateKeyboardViewGestureHandlingModeByMainDictionaryAvailability() { + final MainKeyboardView keyboardView = mKeyboardSwitcher.getKeyboardView(); + if (keyboardView != null) { + final boolean shouldHandleGesture = mCurrentSettings.mGestureInputEnabled + && mIsMainDictionaryAvailable; + keyboardView.setGestureHandlingMode(shouldHandleGesture); + } + } + // TODO: Remove this method from {@link LatinIME} and move {@link FeedbackManager} to // {@link KeyboardSwitcher}. Called from KeyboardSwitcher public void hapticAndAudioFeedback(final int primaryCode) { |