aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java17
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) {