am b5880034: Refactoring.
* commit 'b5880034268111a094c9e684cec9cca784386140': Refactoring.main
commit
ed6522b30b
|
@ -1586,7 +1586,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
|
||||||
mHandler.postUpdateSuggestions();
|
mHandler.postUpdateSuggestions();
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean pickedDefault = false;
|
|
||||||
// Handle separator
|
// Handle separator
|
||||||
final InputConnection ic = getCurrentInputConnection();
|
final InputConnection ic = getCurrentInputConnection();
|
||||||
if (ic != null) {
|
if (ic != null) {
|
||||||
|
@ -1603,27 +1602,26 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
|
||||||
final boolean shouldAutoCorrect = mSettingsValues.mAutoCorrectEnabled
|
final boolean shouldAutoCorrect = mSettingsValues.mAutoCorrectEnabled
|
||||||
&& !mInputTypeNoAutoCorrect;
|
&& !mInputTypeNoAutoCorrect;
|
||||||
if (shouldAutoCorrect && primaryCode != Keyboard.CODE_SINGLE_QUOTE) {
|
if (shouldAutoCorrect && primaryCode != Keyboard.CODE_SINGLE_QUOTE) {
|
||||||
pickedDefault = pickDefaultSuggestion(primaryCode);
|
final boolean pickedDefaultSuggestion = pickDefaultSuggestion(primaryCode);
|
||||||
|
if (pickedDefaultSuggestion) {
|
||||||
|
final CharSequence autoCorrection = mWordComposer.getAutoCorrectionOrNull();
|
||||||
|
final String typedWord = mWordComposer.getTypedWord();
|
||||||
|
if (TextUtils.isEmpty(typedWord)) {
|
||||||
|
throw new RuntimeException("We have non-committed chars but the typed word "
|
||||||
|
+ "is empty? Impossible! I must commit suicide.");
|
||||||
|
}
|
||||||
|
if (!typedWord.equals(autoCorrection)) {
|
||||||
|
// This will make the correction flash for a short while as a visual clue
|
||||||
|
// to the user that auto-correction happened.
|
||||||
|
InputConnectionCompatUtils.commitCorrection(ic,
|
||||||
|
mLastSelectionEnd - typedWord.length(), typedWord, autoCorrection);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
commitTyped(ic);
|
commitTyped(ic);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pickedDefault) {
|
|
||||||
final CharSequence autoCorrection = mWordComposer.getAutoCorrectionOrNull();
|
|
||||||
final String typedWord = mWordComposer.getTypedWord();
|
|
||||||
if (TextUtils.isEmpty(typedWord)) {
|
|
||||||
throw new RuntimeException("We have non-committed chars but the typed word "
|
|
||||||
+ "is empty? Impossible! I must commit suicide.");
|
|
||||||
}
|
|
||||||
if (!typedWord.equals(autoCorrection)) {
|
|
||||||
// This will make the correction flash for a short while as a visual clue
|
|
||||||
// to the user that auto-correction happened.
|
|
||||||
InputConnectionCompatUtils.commitCorrection(
|
|
||||||
ic, mLastSelectionEnd - typedWord.length(), typedWord, autoCorrection);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
final boolean swapMagicSpace;
|
final boolean swapMagicSpace;
|
||||||
if (Keyboard.CODE_ENTER == primaryCode && (SPACE_STATE_MAGIC == spaceState
|
if (Keyboard.CODE_ENTER == primaryCode && (SPACE_STATE_MAGIC == spaceState
|
||||||
|| SPACE_STATE_SWAP_PUNCTUATION == spaceState)) {
|
|| SPACE_STATE_SWAP_PUNCTUATION == spaceState)) {
|
||||||
|
|
Loading…
Reference in New Issue