am ce668e7a: Small clean up.

* commit 'ce668e7a0b6ae7046e1f22a162ad174d58dfe145':
  Small clean up.
main
Jean Chalard 2011-10-25 06:03:08 -07:00 committed by Android Git Automerger
commit 404be78490
1 changed files with 5 additions and 28 deletions

View File

@ -34,8 +34,7 @@ public class TextEntryState {
private static final int SPACE_AFTER_ACCEPTED = 6; private static final int SPACE_AFTER_ACCEPTED = 6;
private static final int SPACE_AFTER_PICKED = 7; private static final int SPACE_AFTER_PICKED = 7;
private static final int UNDO_COMMIT = 8; private static final int UNDO_COMMIT = 8;
private static final int RECORRECTING = 9; private static final int PICKED_RECORRECTION = 9;
private static final int PICKED_RECORRECTION = 10;
private static int sState = UNKNOWN; private static int sState = UNKNOWN;
private static int sPreviousState = UNKNOWN; private static int sPreviousState = UNKNOWN;
@ -78,7 +77,9 @@ public class TextEntryState {
} }
public static void acceptedSuggestion(CharSequence typedWord, CharSequence actualWord) { public static void acceptedSuggestion(CharSequence typedWord, CharSequence actualWord) {
if (sState == RECORRECTING || sState == PICKED_RECORRECTION) { if (sState == PICKED_RECORRECTION) {
// TODO: this seems to be the only place where setState(PICKED_RECORRECTION) is done
// so this state should never be reached. Check this and remove.
setState(PICKED_RECORRECTION); setState(PICKED_RECORRECTION);
} else { } else {
setState(PICKED_SUGGESTION); setState(PICKED_SUGGESTION);
@ -87,18 +88,6 @@ public class TextEntryState {
displayState("acceptedSuggestion", "typedWord", typedWord, "actualWord", actualWord); displayState("acceptedSuggestion", "typedWord", typedWord, "actualWord", actualWord);
} }
public static void selectedForRecorrection() {
setState(RECORRECTING);
if (DEBUG) displayState("selectedForRecorrection");
}
public static void onAbortRecorrection() {
if (sState == RECORRECTING || sState == PICKED_RECORRECTION) {
setState(START);
}
if (DEBUG) displayState("onAbortRecorrection");
}
public static void typedCharacter(char c, boolean isSeparator, int x, int y) { public static void typedCharacter(char c, boolean isSeparator, int x, int y) {
final boolean isSpace = (c == Keyboard.CODE_SPACE); final boolean isSpace = (c == Keyboard.CODE_SPACE);
switch (sState) { switch (sState) {
@ -148,9 +137,6 @@ public class TextEntryState {
setState(IN_WORD); setState(IN_WORD);
} }
break; break;
case RECORRECTING:
setState(START);
break;
} }
RingCharBuffer.getInstance().push(c, x, y); RingCharBuffer.getInstance().push(c, x, y);
if (isSeparator) { if (isSeparator) {
@ -176,20 +162,12 @@ public class TextEntryState {
if (DEBUG) displayState("reset"); if (DEBUG) displayState("reset");
} }
public static boolean isAcceptedDefault() {
return sState == ACCEPTED_DEFAULT;
}
public static boolean isUndoCommit() { public static boolean isUndoCommit() {
return sState == UNDO_COMMIT; return sState == UNDO_COMMIT;
} }
public static boolean isPunctuationAfterAccepted() {
return sState == PUNCTUATION_AFTER_ACCEPTED;
}
public static boolean isRecorrecting() { public static boolean isRecorrecting() {
return sState == RECORRECTING || sState == PICKED_RECORRECTION; return sState == PICKED_RECORRECTION;
} }
public static String getState() { public static String getState() {
@ -206,7 +184,6 @@ public class TextEntryState {
case SPACE_AFTER_ACCEPTED: return "SPACE_AFTER_ACCEPTED"; case SPACE_AFTER_ACCEPTED: return "SPACE_AFTER_ACCEPTED";
case SPACE_AFTER_PICKED: return "SPACE_AFTER_PICKED"; case SPACE_AFTER_PICKED: return "SPACE_AFTER_PICKED";
case UNDO_COMMIT: return "UNDO_COMMIT"; case UNDO_COMMIT: return "UNDO_COMMIT";
case RECORRECTING: return "RECORRECTING";
case PICKED_RECORRECTION: return "PICKED_RECORRECTION"; case PICKED_RECORRECTION: return "PICKED_RECORRECTION";
default: return "UNKNOWN"; default: return "UNKNOWN";
} }