diff options
| author | Tadashi G. Takaoka <takaoka@google.com> | 2011-02-10 20:53:58 +0900 |
|---|---|---|
| committer | Tadashi G. Takaoka <takaoka@google.com> | 2011-02-17 13:59:41 +0900 |
| commit | 887f11ee43ad621aa6ad93d535ab7f48dec73fc7 (patch) | |
| tree | 87d898cdf40cb1f5483bc87c4ad427aa98bd46a5 /java/src/com/android/inputmethod/keyboard/KeyDetector.java | |
| parent | a7b2ac26ee2b9aef6f8cd95849c7d8edbff5082b (diff) | |
Remove next letters frequency handling
Bug: 3428942
Change-Id: Id62f467ce4e50c60a56d59bf96770e799a4659e2
Diffstat (limited to 'java/src/com/android/inputmethod/keyboard/KeyDetector.java')
| -rw-r--r-- | java/src/com/android/inputmethod/keyboard/KeyDetector.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/KeyDetector.java b/java/src/com/android/inputmethod/keyboard/KeyDetector.java index 3979fb53e..1a4f90195 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyDetector.java +++ b/java/src/com/android/inputmethod/keyboard/KeyDetector.java @@ -22,6 +22,7 @@ import java.util.List; public abstract class KeyDetector { public static final int NOT_A_KEY = -1; + public static final int NOT_A_CODE = -1; protected Keyboard mKeyboard; @@ -105,10 +106,10 @@ public abstract class KeyDetector { * * @param x The x-coordinate of a touch point * @param y The y-coordinate of a touch point - * @param allKeys All nearby key indices are returned in this array + * @param allCodes All nearby key code except functional key are returned in this array * @return The nearest key index */ - abstract public int getKeyIndexAndNearbyCodes(int x, int y, int[] allKeys); + abstract public int getKeyIndexAndNearbyCodes(int x, int y, final int[] allCodes); /** * Compute the most common key width in order to use it as proximity key detection threshold. @@ -116,14 +117,14 @@ public abstract class KeyDetector { * @param keyboard The keyboard to compute the most common key width * @return The most common key width in the keyboard */ - public static int getMostCommonKeyWidth(Keyboard keyboard) { + public static int getMostCommonKeyWidth(final Keyboard keyboard) { if (keyboard == null) return 0; final List<Key> keys = keyboard.getKeys(); if (keys == null || keys.size() == 0) return 0; final HashMap<Integer, Integer> histogram = new HashMap<Integer, Integer>(); int maxCount = 0; int mostCommonWidth = 0; - for (Key key : keys) { + for (final Key key : keys) { final Integer width = key.mWidth + key.mGap; Integer count = histogram.get(width); if (count == null) |
