diff options
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 15 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/latin/Settings.java | 20 |
2 files changed, 10 insertions, 25 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index a8118e549..d9d421411 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1442,8 +1442,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // not to auto correct, but accept the typed word. For instance, // in Italian dov' should not be expanded to dove' because the elision // requires the last vowel to be removed. - final boolean shouldAutoCorrect = - (mSettingsValues.mAutoCorrectEnabled || mSettingsValues.mQuickFixes) + final boolean shouldAutoCorrect = mSettingsValues.mAutoCorrectEnabled && !mInputTypeNoAutoCorrect && mHasDictionary; if (shouldAutoCorrect && primaryCode != Keyboard.CODE_SINGLE_QUOTE) { pickedDefault = pickDefaultSuggestion(primaryCode); @@ -2085,8 +2084,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar private void updateCorrectionMode() { // TODO: cleanup messy flags mHasDictionary = mSuggest != null ? mSuggest.hasMainDictionary() : false; - final boolean shouldAutoCorrect = (mSettingsValues.mAutoCorrectEnabled - || mSettingsValues.mQuickFixes) && !mInputTypeNoAutoCorrect && mHasDictionary; + final boolean shouldAutoCorrect = mSettingsValues.mAutoCorrectEnabled + && !mInputTypeNoAutoCorrect && mHasDictionary; mCorrectionMode = (shouldAutoCorrect && mSettingsValues.mAutoCorrectEnabled) ? Suggest.CORRECTION_FULL : (shouldAutoCorrect ? Suggest.CORRECTION_BASIC : Suggest.CORRECTION_NONE); @@ -2100,7 +2099,13 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar private void updateAutoTextEnabled() { if (mSuggest == null) return; - mSuggest.setQuickFixesEnabled(mSettingsValues.mQuickFixes + // We want to use autotext if the settings are asking for auto corrections, and if + // the input language is the same as the system language (because autotext will only + // work in the system language so if we are entering text in a different language we + // do not want it on). + // We used to look at the "quick fixes" option instead of mAutoCorrectEnabled, but + // this option was redundant and confusing and therefore removed. + mSuggest.setQuickFixesEnabled(mSettingsValues.mAutoCorrectEnabled && SubtypeSwitcher.getInstance().isSystemLanguageSameAsInputLanguage()); } diff --git a/java/src/com/android/inputmethod/latin/Settings.java b/java/src/com/android/inputmethod/latin/Settings.java index 6a4837163..dbab227db 100644 --- a/java/src/com/android/inputmethod/latin/Settings.java +++ b/java/src/com/android/inputmethod/latin/Settings.java @@ -69,7 +69,6 @@ public class Settings extends InputMethodSettingsActivity public static final String PREF_CONFIGURE_DICTIONARIES_KEY = "configure_dictionaries_key"; public static final String PREF_CORRECTION_SETTINGS_KEY = "correction_settings"; - public static final String PREF_QUICK_FIXES = "quick_fixes"; public static final String PREF_SHOW_SUGGESTIONS_SETTING = "show_suggestions_setting"; public static final String PREF_AUTO_CORRECTION_THRESHOLD = "auto_correction_threshold"; public static final String PREF_DEBUG_SETTINGS = "debug_settings"; @@ -111,7 +110,6 @@ public class Settings extends InputMethodSettingsActivity public final boolean mKeyPreviewPopupOn; public final int mKeyPreviewPopupDismissDelay; public final boolean mAutoCap; - public final boolean mQuickFixes; public final boolean mAutoCorrectEnabled; public final double mAutoCorrectionThreshold; // Suggestion: use bigrams to adjust scores of suggestions obtained from unigram dictionary @@ -171,7 +169,6 @@ public class Settings extends InputMethodSettingsActivity mKeyPreviewPopupOn = isKeyPreviewPopupEnabled(prefs, res); mKeyPreviewPopupDismissDelay = getKeyPreviewPopupDismissDelay(prefs, res); mAutoCap = prefs.getBoolean(Settings.PREF_AUTO_CAP, true); - mQuickFixes = isQuickFixesEnabled(prefs, res); mAutoCorrectEnabled = isAutoCorrectEnabled(prefs, res); mBigramSuggestionEnabled = mAutoCorrectEnabled @@ -208,17 +205,6 @@ public class Settings extends InputMethodSettingsActivity return mMagicSpaceSwappers.contains(String.valueOf((char)code)); } - // Helper methods - private static boolean isQuickFixesEnabled(SharedPreferences sp, Resources resources) { - final boolean showQuickFixesOption = resources.getBoolean( - R.bool.config_enable_quick_fixes_option); - if (!showQuickFixesOption) { - return isAutoCorrectEnabled(sp, resources); - } - return sp.getBoolean(Settings.PREF_QUICK_FIXES, resources.getBoolean( - R.bool.config_default_quick_fixes)); - } - private static boolean isAutoCorrectEnabled(SharedPreferences sp, Resources resources) { final String currentAutoCorrectionSetting = sp.getString( Settings.PREF_AUTO_CORRECTION_THRESHOLD, @@ -419,12 +405,6 @@ public class Settings extends InputMethodSettingsActivity generalSettings.removePreference(findPreference(PREF_RECORRECTION_ENABLED)); } - final boolean showQuickFixesOption = res.getBoolean( - R.bool.config_enable_quick_fixes_option); - if (!showQuickFixesOption) { - textCorrectionGroup.removePreference(findPreference(PREF_QUICK_FIXES)); - } - final boolean showBigramSuggestionsOption = res.getBoolean( R.bool.config_enable_bigram_suggestions_option); if (!showBigramSuggestionsOption) { |