aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LastComposedWord.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-02-21 23:17:54 -0800
committerJean Chalard <jchalard@google.com>2012-02-21 23:33:58 -0800
commit66bb563535dbe3672f99f75bd71763a551444867 (patch)
tree6cf74a9cab2fd3e29a8ca573e61adce47993eace /java/src/com/android/inputmethod/latin/LastComposedWord.java
parentcf9d92629cae88273805eaf7984fcfdd8afd11f5 (diff)
downloadlatinime-66bb563535dbe3672f99f75bd71763a551444867.tar.gz
latinime-66bb563535dbe3672f99f75bd71763a551444867.tar.xz
latinime-66bb563535dbe3672f99f75bd71763a551444867.zip
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
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LastComposedWord.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LastComposedWord.java9
1 files changed, 7 insertions, 2 deletions
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<int[]> 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<int[]> 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;
}