From 66bb563535dbe3672f99f75bd71763a551444867 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Tue, 21 Feb 2012 23:17:54 -0800 Subject: Give LastComposedWord knowledge of the separator (A2) This stores the separator that was used to commit the word in the LastComposedWord. It may be NOT_A_SEPARATOR if there was no separator (for example, the cursor moved causing a commit, or there was a manual pick). This is necessary to implement feature request #5968922. Change-Id: I5fcf19a78ec66d68d4df89418eaef13952588207 --- java/src/com/android/inputmethod/latin/LastComposedWord.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'java/src/com/android/inputmethod/latin/LastComposedWord.java') diff --git a/java/src/com/android/inputmethod/latin/LastComposedWord.java b/java/src/com/android/inputmethod/latin/LastComposedWord.java index 37be03c3e..f0b91b104 100644 --- a/java/src/com/android/inputmethod/latin/LastComposedWord.java +++ b/java/src/com/android/inputmethod/latin/LastComposedWord.java @@ -40,26 +40,31 @@ public class LastComposedWord { // an auto-correction. public static final int COMMIT_TYPE_CANCEL_AUTO_CORRECT = 3; + public static final int NOT_A_SEPARATOR = -1; + public final ArrayList mCodes; public final int[] mXCoordinates; public final int[] mYCoordinates; public final String mTypedWord; public final String mCommittedWord; + public final int mSeparatorCode; private boolean mActive; public static final LastComposedWord NOT_A_COMPOSED_WORD = - new LastComposedWord(null, null, null, "", ""); + new LastComposedWord(null, null, null, "", "", NOT_A_SEPARATOR); // Warning: this is using the passed objects as is and fully expects them to be // immutable. Do not fiddle with their contents after you passed them to this constructor. public LastComposedWord(final ArrayList codes, final int[] xCoordinates, - final int[] yCoordinates, final String typedWord, final String committedWord) { + final int[] yCoordinates, final String typedWord, final String committedWord, + final int separatorCode) { mCodes = codes; mXCoordinates = xCoordinates; mYCoordinates = yCoordinates; mTypedWord = typedWord; mCommittedWord = committedWord; + mSeparatorCode = separatorCode; mActive = true; } -- cgit v1.2.3-83-g751a