diff options
author | 2012-03-19 14:47:38 +0900 | |
---|---|---|
committer | 2012-03-19 18:33:59 +0900 | |
commit | 728d1c884e99e1fd25aa253b5ad30dbdb046ad5f (patch) | |
tree | 007d6c95c0cd28481ddde73dab2acd7a62261479 /java/src/com/android/inputmethod/latin/WordComposer.java | |
parent | f9c2773b093213b9fc5495b78ab4a6b1a2009050 (diff) | |
download | latinime-728d1c884e99e1fd25aa253b5ad30dbdb046ad5f.tar.gz latinime-728d1c884e99e1fd25aa253b5ad30dbdb046ad5f.tar.xz latinime-728d1c884e99e1fd25aa253b5ad30dbdb046ad5f.zip |
Cleanup proximity related code
Bug: 4343280
Change-Id: I57c0f9e20d9d8911009ea97057251a7f7a81512f
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); } |