aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-03-23 02:56:10 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-03-23 02:56:10 -0700
commitc4f69e7d68b0f7a5aa58388cafe2c1cca98d897b (patch)
tree7304071b88383896bcb2b2fd065fc0b0cf3af304 /java/src
parent2b5b6388d6b16e8644e02e71e6e8810e913ff9f8 (diff)
parenta492790982c6d7df62f66344db30b31995800e1b (diff)
downloadlatinime-c4f69e7d68b0f7a5aa58388cafe2c1cca98d897b.tar.gz
latinime-c4f69e7d68b0f7a5aa58388cafe2c1cca98d897b.tar.xz
latinime-c4f69e7d68b0f7a5aa58388cafe2c1cca98d897b.zip
Merge "Stop creating useless objects"
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/WordComposer.java18
1 files changed, 3 insertions, 15 deletions
diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java
index 231211d31..ebd802fae 100644
--- a/java/src/com/android/inputmethod/latin/WordComposer.java
+++ b/java/src/com/android/inputmethod/latin/WordComposer.java
@@ -172,8 +172,7 @@ public class WordComposer {
/**
* Internal method to retrieve reasonable proximity info for a character.
*/
- private void addKeyInfo(final int codePoint, final Keyboard keyboard,
- final KeyDetector keyDetector) {
+ private void addKeyInfo(final int codePoint, final Keyboard keyboard) {
for (final Key key : keyboard.mKeys) {
if (key.mCode == codePoint) {
final int x = key.mX + key.mWidth / 2;
@@ -191,27 +190,16 @@ 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.
*/
- private void setComposingWord(final CharSequence word, final Keyboard keyboard,
- final KeyDetector keyDetector) {
+ public void setComposingWord(final CharSequence word, final Keyboard keyboard) {
reset();
final int length = word.length();
for (int i = 0; i < length; i = Character.offsetByCodePoints(word, i, 1)) {
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);
- }
-
- /**
* Delete the last keystroke as a result of hitting backspace.
*/
public void deleteLast() {