aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2011-03-02 10:48:45 -0800
committerTadashi G. Takaoka <takaoka@google.com>2011-03-02 11:14:04 -0800
commit6f99d12b0752ecdbceda7e5fddead214f939f533 (patch)
treed226ef2d34ce8c8f4c7bbc7adccf16ba8927aeff /java
parent8bf93c4ba550faaf790475e49d83833c8c4f31b3 (diff)
downloadlatinime-6f99d12b0752ecdbceda7e5fddead214f939f533.tar.gz
latinime-6f99d12b0752ecdbceda7e5fddead214f939f533.tar.xz
latinime-6f99d12b0752ecdbceda7e5fddead214f939f533.zip
Enable re-correction even after revert auto-correction
This change removes the boolean flag mJustReverted. Because we preserve separator after canceling auto-correction according to bug#3230708, there is no need for this flag now. Bug: 3193810 Change-Id: Icea06ece569774b494ffa4ca4a899c898661cc19
Diffstat (limited to 'java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java14
1 files changed, 3 insertions, 11 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index e2888e8e4..f1b96ad5d 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -193,7 +193,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// Indicates whether the suggestion strip is to be on in landscape
private boolean mJustAccepted;
- private boolean mJustReverted;
private int mDeleteCount;
private long mLastKeyTime;
@@ -769,7 +768,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// Don't look for corrections if the keyboard is not visible
if (mKeyboardSwitcher.isInputViewShown()) {
// Check if we should go in or out of correction mode.
- if (isSuggestionsRequested() && !mJustReverted
+ if (isSuggestionsRequested()
&& (candidatesStart == candidatesEnd || newSelStart != oldSelStart
|| TextEntryState.isRecorrecting())
&& (newSelStart < newSelEnd - 1 || !mHasValidSuggestions)) {
@@ -1174,8 +1173,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
} else {
handleCharacter(primaryCode, keyCodes, x, y);
}
- // Cancel the just reverted state
- mJustReverted = false;
}
switcher.onKey(primaryCode);
// Reset after any single keystroke
@@ -1195,7 +1192,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
ic.endBatchEdit();
mKeyboardSwitcher.updateShiftState();
mKeyboardSwitcher.onKey(Keyboard.CODE_DUMMY);
- mJustReverted = false;
mJustAddedAutoSpace = false;
mEnteredText = text;
}
@@ -1260,7 +1256,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
}
}
- mJustReverted = false;
ic.endBatchEdit();
}
@@ -1377,7 +1372,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// 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.
- if (mAutoCorrectOn && primaryCode != '\'' && !mJustReverted) {
+ if (mAutoCorrectOn && primaryCode != '\'') {
pickedDefault = pickDefaultSuggestion();
// Picked the suggestion by the space key. We consider this
// as "added an auto space".
@@ -1549,8 +1544,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
SuggestedWords.Builder builder = mSuggest.getSuggestedWordBuilder(
mKeyboardSwitcher.getInputView(), word, prevWord);
- boolean correctionAvailable = !mInputTypeNoAutoCorrect && !mJustReverted
- && mSuggest.hasAutoCorrection();
+ boolean correctionAvailable = !mInputTypeNoAutoCorrect && mSuggest.hasAutoCorrection();
final CharSequence typedWord = word.getTypedWord();
// If we're in basic correct
final boolean typedWordValid = mSuggest.isValidWord(typedWord) ||
@@ -1880,7 +1874,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
final int length = mComposing.length();
if (!mHasValidSuggestions && length > 0) {
final InputConnection ic = getCurrentInputConnection();
- mJustReverted = true;
final CharSequence punctuation = ic.getTextBeforeCursor(1, 0);
if (deleteChar) ic.deleteSurroundingText(1, 0);
int toDelete = mCommittedLength;
@@ -1908,7 +1901,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mHandler.postUpdateSuggestions();
} else {
sendDownUpKeyEvents(KeyEvent.KEYCODE_DEL);
- mJustReverted = false;
}
}