Merge "Consolidate auto-correction settings."

main
Jean Chalard 2012-06-12 11:29:21 -07:00 committed by Android (Google) Code Review
commit 53eedaea92
2 changed files with 8 additions and 12 deletions

View File

@ -449,7 +449,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
oldContactsDictionary = null; oldContactsDictionary = null;
} }
mSuggest = new Suggest(this, subtypeLocale); mSuggest = new Suggest(this, subtypeLocale);
if (mCurrentSettings.mAutoCorrectEnabled) { if (mCurrentSettings.isCorrectionOn()) {
mSuggest.setAutoCorrectionThreshold(mCurrentSettings.mAutoCorrectionThreshold); mSuggest.setAutoCorrectionThreshold(mCurrentSettings.mAutoCorrectionThreshold);
} }
@ -680,7 +680,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
loadSettings(); loadSettings();
if (mSuggest != null && mCurrentSettings.mAutoCorrectEnabled) { if (mSuggest != null && mCurrentSettings.isCorrectionOn()) {
mSuggest.setAutoCorrectionThreshold(mCurrentSettings.mAutoCorrectionThreshold); mSuggest.setAutoCorrectionThreshold(mCurrentSettings.mAutoCorrectionThreshold);
} }
@ -1553,8 +1553,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// not to auto correct, but accept the typed word. For instance, // not to auto correct, but accept the typed word. For instance,
// in Italian dov' should not be expanded to dove' because the elision // in Italian dov' should not be expanded to dove' because the elision
// requires the last vowel to be removed. // requires the last vowel to be removed.
final boolean shouldAutoCorrect = mCurrentSettings.mAutoCorrectEnabled final boolean shouldAutoCorrect = mCurrentSettings.isCorrectionOn();
&& !mInputAttributes.mInputTypeNoAutoCorrect;
if (shouldAutoCorrect && primaryCode != Keyboard.CODE_SINGLE_QUOTE) { if (shouldAutoCorrect && primaryCode != Keyboard.CODE_SINGLE_QUOTE) {
commitCurrentAutoCorrection(primaryCode); commitCurrentAutoCorrection(primaryCode);
didAutoCorrect = true; didAutoCorrect = true;
@ -1914,14 +1913,11 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mConnection.commitText(SuggestionSpanUtils.getTextWithSuggestionSpan( mConnection.commitText(SuggestionSpanUtils.getTextWithSuggestionSpan(
this, chosenWord, suggestedWords, mIsMainDictionaryAvailable), this, chosenWord, suggestedWords, mIsMainDictionaryAvailable),
1); 1);
if (ProductionFlag.IS_EXPERIMENTAL) {
ResearchLogger.latinIME_commitText(chosenWord);
}
} else { } else {
mConnection.commitText(chosenWord, 1); mConnection.commitText(chosenWord, 1);
if (ProductionFlag.IS_EXPERIMENTAL) { }
ResearchLogger.latinIME_commitText(chosenWord); if (ProductionFlag.IS_EXPERIMENTAL) {
} ResearchLogger.latinIME_commitText(chosenWord);
} }
// Add the word to the user history dictionary // Add the word to the user history dictionary
final CharSequence prevWord = addToUserHistoryDictionary(chosenWord); final CharSequence prevWord = addToUserHistoryDictionary(chosenWord);
@ -2231,7 +2227,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
p.println(" mIsSuggestionsRequested=" + mInputAttributes.mIsSettingsSuggestionStripOn); p.println(" mIsSuggestionsRequested=" + mInputAttributes.mIsSettingsSuggestionStripOn);
p.println(" mCorrectionMode=" + mCurrentSettings.mCorrectionMode); p.println(" mCorrectionMode=" + mCurrentSettings.mCorrectionMode);
p.println(" isComposingWord=" + mWordComposer.isComposingWord()); p.println(" isComposingWord=" + mWordComposer.isComposingWord());
p.println(" mAutoCorrectEnabled=" + mCurrentSettings.mAutoCorrectEnabled); p.println(" isCorrectionOn=" + mCurrentSettings.isCorrectionOn());
p.println(" mSoundOn=" + mCurrentSettings.mSoundOn); p.println(" mSoundOn=" + mCurrentSettings.mSoundOn);
p.println(" mVibrateOn=" + mCurrentSettings.mVibrateOn); p.println(" mVibrateOn=" + mCurrentSettings.mVibrateOn);
p.println(" mKeyPreviewPopupOn=" + mCurrentSettings.mKeyPreviewPopupOn); p.println(" mKeyPreviewPopupOn=" + mCurrentSettings.mKeyPreviewPopupOn);

View File

@ -91,7 +91,7 @@ public class SettingsValues {
public final int mKeypressVibrationDuration; public final int mKeypressVibrationDuration;
public final float mFxVolume; public final float mFxVolume;
public final int mKeyPreviewPopupDismissDelay; public final int mKeyPreviewPopupDismissDelay;
public final boolean mAutoCorrectEnabled; private final boolean mAutoCorrectEnabled;
public final float mAutoCorrectionThreshold; public final float mAutoCorrectionThreshold;
public final int mCorrectionMode; public final int mCorrectionMode;
public final int mSuggestionVisibility; public final int mSuggestionVisibility;