diff options
| author | Tadashi G. Takaoka <takaoka@google.com> | 2011-07-07 22:31:29 -0700 |
|---|---|---|
| committer | Tadashi G. Takaoka <takaoka@google.com> | 2011-07-07 23:31:04 -0700 |
| commit | 5a7a696aff6718d4e0250c394a9d01cbf2a16916 (patch) | |
| tree | e7851a9acaf1281ea1183e8c6067f19f574e7fe6 /java/src/com/android/inputmethod/keyboard/KeyDetector.java | |
| parent | 1c9817f0e66f2bf77706f07ba48075ed4be3a970 (diff) | |
Let KeyDetector hold Keyboard
Bug: 4768084
Change-Id: Ia28d6971fc59086dd4e6fedc9fd1b50f13b59854
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, 4 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/KeyDetector.java b/java/src/com/android/inputmethod/keyboard/KeyDetector.java index 85418a61d..6d25025c5 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyDetector.java +++ b/java/src/com/android/inputmethod/keyboard/KeyDetector.java @@ -73,11 +73,10 @@ public class KeyDetector { return y + mCorrectionY; } - protected List<Key> getKeys() { + public Keyboard getKeyboard() { if (mKeyboard == null) throw new IllegalStateException("keyboard isn't set"); - // mKeyboard is guaranteed not to be null at setKeybaord() method if mKeys is not null - return mKeyboard.getKeys(); + return mKeyboard; } public void setProximityCorrectionEnabled(boolean enabled) { @@ -154,7 +153,7 @@ public class KeyDetector { } private void getNearbyKeyCodes(final int[] allCodes) { - final List<Key> keys = getKeys(); + final List<Key> keys = getKeyboard().getKeys(); final int[] indices = mIndices; // allCodes[0] should always have the key code even if it is a non-letter key. @@ -188,7 +187,7 @@ public class KeyDetector { * @return The nearest key index */ public int getKeyIndexAndNearbyCodes(int x, int y, final int[] allCodes) { - final List<Key> keys = getKeys(); + final List<Key> keys = getKeyboard().getKeys(); final int touchX = getTouchX(x); final int touchY = getTouchY(y); |
