diff options
author | 2010-09-07 15:37:32 +0900 | |
---|---|---|
committer | 2010-09-07 15:37:32 +0900 | |
commit | e1cb2e4977b3fecd5622bd00d0db512333a628b8 (patch) | |
tree | 7e7dc29de6127e045d29ba7d297cfb43dafebba0 /java/src | |
parent | 6a454a9fa0a9b097d0237de989227e19ec427f47 (diff) | |
parent | 36d2d0e736605141006108d573614ab3343a0600 (diff) | |
download | latinime-e1cb2e4977b3fecd5622bd00d0db512333a628b8.tar.gz latinime-e1cb2e4977b3fecd5622bd00d0db512333a628b8.tar.xz latinime-e1cb2e4977b3fecd5622bd00d0db512333a628b8.zip |
resolved conflicts for merge of 36d2d0e7 to master
Change-Id: Ib4b6ef593d7f4ce5b0666f2e0987ee8398cabe12
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 72efc969c..335778980 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -127,6 +127,7 @@ public class LatinIME extends InputMethodService public static final String PREF_SELECTED_LANGUAGES = "selected_languages"; public static final String PREF_INPUT_LANGUAGE = "input_language"; + private static final String PREF_RECORRECTION_ENABLED = "recorrection_enabled"; private static final int MSG_UPDATE_SUGGESTIONS = 0; private static final int MSG_START_TUTORIAL = 1; @@ -193,6 +194,7 @@ public class LatinIME extends InputMethodService private boolean mAutoSpace; private boolean mJustAddedAutoSpace; private boolean mAutoCorrectEnabled; + private boolean mReCorrectionEnabled; private boolean mBigramSuggestionEnabled; private boolean mAutoCorrectOn; // TODO move this state variable outside LatinIME @@ -360,6 +362,8 @@ public class LatinIME extends InputMethodService if (inputLanguage == null) { inputLanguage = conf.locale.toString(); } + mReCorrectionEnabled = prefs.getBoolean(PREF_RECORRECTION_ENABLED, + getResources().getBoolean(R.bool.default_recorrection_enabled)); LatinIMEUtil.GCUtils.getInstance().reset(); boolean tryGC = true; @@ -768,21 +772,22 @@ public class LatinIME extends InputMethodService mLastSelectionStart = newSelStart; mLastSelectionEnd = newSelEnd; - - // Don't look for corrections if the keyboard is not visible - if (mKeyboardSwitcher != null && mKeyboardSwitcher.getInputView() != null - && mKeyboardSwitcher.getInputView().isShown()) { - // Check if we should go in or out of correction mode. - if (isPredictionOn() - && mJustRevertedSeparator == null - && (candidatesStart == candidatesEnd || newSelStart != oldSelStart - || TextEntryState.isCorrecting()) - && (newSelStart < newSelEnd - 1 || (!mPredicting)) - && !mVoiceInputHighlighted) { - if (isCursorTouchingWord() || mLastSelectionStart < mLastSelectionEnd) { - postUpdateOldSuggestions(); - } else { - abortCorrection(false); + if (mReCorrectionEnabled) { + // Don't look for corrections if the keyboard is not visible + if (mKeyboardSwitcher != null && mKeyboardSwitcher.getInputView() != null + && mKeyboardSwitcher.getInputView().isShown()) { + // Check if we should go in or out of correction mode. + if (isPredictionOn() + && mJustRevertedSeparator == null + && (candidatesStart == candidatesEnd || newSelStart != oldSelStart + || TextEntryState.isCorrecting()) + && (newSelStart < newSelEnd - 1 || (!mPredicting)) + && !mVoiceInputHighlighted) { + if (isCursorTouchingWord() || mLastSelectionStart < mLastSelectionEnd) { + postUpdateOldSuggestions(); + } else { + abortCorrection(false); + } } } } @@ -2180,6 +2185,9 @@ public class LatinIME extends InputMethodService if (PREF_SELECTED_LANGUAGES.equals(key)) { mLanguageSwitcher.loadLocales(sharedPreferences); mRefreshKeyboardRequired = true; + } else if (PREF_RECORRECTION_ENABLED.equals(key)) { + mReCorrectionEnabled = sharedPreferences.getBoolean(PREF_RECORRECTION_ENABLED, + getResources().getBoolean(R.bool.default_recorrection_enabled)); } } |