diff options
author | 2012-03-19 02:40:25 -0700 | |
---|---|---|
committer | 2012-03-19 02:40:25 -0700 | |
commit | 1fe943aabdf6c9a40c634bf4a5450cbed4f6c136 (patch) | |
tree | 5414ba26097d597a405a391d6ba596557e05a987 /java/src/com/android/inputmethod/latin/WordComposer.java | |
parent | 546b8275ab111264972b290d2b88b12e03288812 (diff) | |
parent | 728d1c884e99e1fd25aa253b5ad30dbdb046ad5f (diff) | |
download | latinime-1fe943aabdf6c9a40c634bf4a5450cbed4f6c136.tar.gz latinime-1fe943aabdf6c9a40c634bf4a5450cbed4f6c136.tar.xz latinime-1fe943aabdf6c9a40c634bf4a5450cbed4f6c136.zip |
Merge "Cleanup proximity related code"
Diffstat (limited to 'java/src/com/android/inputmethod/latin/WordComposer.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/WordComposer.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java index 251063ec4..9f23f174f 100644 --- a/java/src/com/android/inputmethod/latin/WordComposer.java +++ b/java/src/com/android/inputmethod/latin/WordComposer.java @@ -141,6 +141,7 @@ public class WordComposer { keyY = y; } else { final Key key = keyDetector.detectHitKey(x, y); + // TODO: Pass an integer instead of an integer array codes = new int[] { key != null ? key.mCode : NOT_A_CODE }; keyX = keyDetector.getTouchX(x); keyY = keyDetector.getTouchY(y); @@ -202,9 +203,8 @@ public class WordComposer { if (key.mCode == codePoint) { final int x = key.mX + key.mWidth / 2; final int y = key.mY + key.mHeight / 2; - final int[] codes = keyDetector.newCodeArray(); - keyDetector.getNearbyCodes(x, y, codes); - add(codePoint, codes, x, y); + // TODO: Pass an integer instead of an integer array + add(codePoint, new int[] { key.mCode }, x, y); return; } } @@ -216,7 +216,7 @@ public class WordComposer { * Set the currently composing word to the one passed as an argument. * This will register NOT_A_COORDINATE for X and Ys, and use the passed keyboard for proximity. */ - public void setComposingWord(final CharSequence word, final Keyboard keyboard, + private void setComposingWord(final CharSequence word, final Keyboard keyboard, final KeyDetector keyDetector) { reset(); final int length = word.length(); @@ -233,7 +233,6 @@ public class WordComposer { final KeyDetector keyDetector = new KeyDetector(0); keyDetector.setKeyboard(keyboard, 0, 0); keyDetector.setProximityCorrectionEnabled(true); - keyDetector.setProximityThreshold(keyboard.mMostCommonKeyWidth); setComposingWord(word, keyboard, keyDetector); } |