Loading java/src/com/android/inputmethod/latin/WordComposer.java +3 −15 Original line number Original line Diff line number Diff line Loading @@ -172,8 +172,7 @@ public class WordComposer { /** /** * Internal method to retrieve reasonable proximity info for a character. * Internal method to retrieve reasonable proximity info for a character. */ */ private void addKeyInfo(final int codePoint, final Keyboard keyboard, private void addKeyInfo(final int codePoint, final Keyboard keyboard) { final KeyDetector keyDetector) { for (final Key key : keyboard.mKeys) { for (final Key key : keyboard.mKeys) { if (key.mCode == codePoint) { if (key.mCode == codePoint) { final int x = key.mX + key.mWidth / 2; final int x = key.mX + key.mWidth / 2; Loading @@ -191,24 +190,13 @@ public class WordComposer { * Set the currently composing word to the one passed as an argument. * 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. * This will register NOT_A_COORDINATE for X and Ys, and use the passed keyboard for proximity. */ */ private void setComposingWord(final CharSequence word, final Keyboard keyboard, public void setComposingWord(final CharSequence word, final Keyboard keyboard) { final KeyDetector keyDetector) { reset(); reset(); final int length = word.length(); final int length = word.length(); for (int i = 0; i < length; i = Character.offsetByCodePoints(word, i, 1)) { for (int i = 0; i < length; i = Character.offsetByCodePoints(word, i, 1)) { int codePoint = Character.codePointAt(word, i); int codePoint = Character.codePointAt(word, i); addKeyInfo(codePoint, keyboard, keyDetector); addKeyInfo(codePoint, keyboard); } } } /** * Shortcut for the above method, this will create a new KeyDetector for the passed keyboard. */ public void setComposingWord(final CharSequence word, final Keyboard keyboard) { final KeyDetector keyDetector = new KeyDetector(0); keyDetector.setKeyboard(keyboard, 0, 0); keyDetector.setProximityCorrectionEnabled(true); setComposingWord(word, keyboard, keyDetector); } } /** /** Loading Loading
java/src/com/android/inputmethod/latin/WordComposer.java +3 −15 Original line number Original line Diff line number Diff line Loading @@ -172,8 +172,7 @@ public class WordComposer { /** /** * Internal method to retrieve reasonable proximity info for a character. * Internal method to retrieve reasonable proximity info for a character. */ */ private void addKeyInfo(final int codePoint, final Keyboard keyboard, private void addKeyInfo(final int codePoint, final Keyboard keyboard) { final KeyDetector keyDetector) { for (final Key key : keyboard.mKeys) { for (final Key key : keyboard.mKeys) { if (key.mCode == codePoint) { if (key.mCode == codePoint) { final int x = key.mX + key.mWidth / 2; final int x = key.mX + key.mWidth / 2; Loading @@ -191,24 +190,13 @@ public class WordComposer { * Set the currently composing word to the one passed as an argument. * 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. * This will register NOT_A_COORDINATE for X and Ys, and use the passed keyboard for proximity. */ */ private void setComposingWord(final CharSequence word, final Keyboard keyboard, public void setComposingWord(final CharSequence word, final Keyboard keyboard) { final KeyDetector keyDetector) { reset(); reset(); final int length = word.length(); final int length = word.length(); for (int i = 0; i < length; i = Character.offsetByCodePoints(word, i, 1)) { for (int i = 0; i < length; i = Character.offsetByCodePoints(word, i, 1)) { int codePoint = Character.codePointAt(word, i); int codePoint = Character.codePointAt(word, i); addKeyInfo(codePoint, keyboard, keyDetector); addKeyInfo(codePoint, keyboard); } } } /** * Shortcut for the above method, this will create a new KeyDetector for the passed keyboard. */ public void setComposingWord(final CharSequence word, final Keyboard keyboard) { final KeyDetector keyDetector = new KeyDetector(0); keyDetector.setKeyboard(keyboard, 0, 0); keyDetector.setProximityCorrectionEnabled(true); setComposingWord(word, keyboard, keyDetector); } } /** /** Loading