aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/KeyDetector.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2010-09-02 06:01:00 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-09-02 06:01:00 -0700
commit7f67c211e7ec4bdf148c9dd468cc8e73ffeb66e3 (patch)
treeca3016d2c33cc19720e4d3a637df83b71325b84e /java/src/com/android/inputmethod/latin/KeyDetector.java
parenta4397ce38af2e1ac3a8284bc078bd1e9cb4fecf4 (diff)
parent400046d62e22899e28efd2a62321c637c7831f81 (diff)
downloadlatinime-7f67c211e7ec4bdf148c9dd468cc8e73ffeb66e3.tar.gz
latinime-7f67c211e7ec4bdf148c9dd468cc8e73ffeb66e3.tar.xz
latinime-7f67c211e7ec4bdf148c9dd468cc8e73ffeb66e3.zip
am 400046d6: Encapsulate vertical and horizontal correction values into KeyDetector.
Merge commit '400046d62e22899e28efd2a62321c637c7831f81' into gingerbread-plus-aosp * commit '400046d62e22899e28efd2a62321c637c7831f81': Encapsulate vertical and horizontal correction values into KeyDetector.
Diffstat (limited to 'java/src/com/android/inputmethod/latin/KeyDetector.java')
-rw-r--r--java/src/com/android/inputmethod/latin/KeyDetector.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/latin/KeyDetector.java b/java/src/com/android/inputmethod/latin/KeyDetector.java
index 11d5f861d..5583e3275 100644
--- a/java/src/com/android/inputmethod/latin/KeyDetector.java
+++ b/java/src/com/android/inputmethod/latin/KeyDetector.java
@@ -25,12 +25,16 @@ abstract class KeyDetector {
protected Keyboard mKeyboard;
protected Key[] mKeys;
+ protected int mCorrectionX;
+ protected int mCorrectionY;
protected boolean mProximityCorrectOn;
protected int mProximityThresholdSquare;
- public Key[] setKeyboard(Keyboard keyboard) {
+ public Key[] setKeyboard(Keyboard keyboard, float correctionX, float correctionY) {
if (keyboard == null)
throw new NullPointerException();
+ mCorrectionX = (int)correctionX;
+ mCorrectionY = (int)correctionY;
mKeyboard = keyboard;
List<Key> keys = mKeyboard.getKeys();
Key[] array = keys.toArray(new Key[keys.size()]);
@@ -38,6 +42,14 @@ abstract class KeyDetector {
return array;
}
+ protected int getTouchX(int x) {
+ return x + mCorrectionX;
+ }
+
+ protected int getTouchY(int y) {
+ return y + mCorrectionY;
+ }
+
public void setProximityCorrectionEnabled(boolean enabled) {
mProximityCorrectOn = enabled;
}