diff options
| author | Amith Yamasani <yamasani@google.com> | 2010-02-08 15:24:57 -0800 |
|---|---|---|
| committer | Amith Yamasani <yamasani@google.com> | 2010-02-08 15:26:00 -0800 |
| commit | ec5df83c5b44ad2f2b28a1a4420c4c4056dd6103 (patch) | |
| tree | 43d208c8bd8cb4e79e8768a0319dad7700316270 /core | |
| parent | 7723c94d3295de4e9a2b14cbf9f3a9a999f201d2 (diff) | |
| download | frameworks_base-ec5df83c5b44ad2f2b28a1a4420c4c4056dd6103.zip frameworks_base-ec5df83c5b44ad2f2b28a1a4420c4c4056dd6103.tar.gz frameworks_base-ec5df83c5b44ad2f2b28a1a4420c4c4056dd6103.tar.bz2 | |
Fix to enable having a primary index that's not the closest match.
Needed for predictive hit target correction in LatinIME.
Diffstat (limited to 'core')
| -rwxr-xr-x | core/java/android/inputmethodservice/KeyboardView.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/java/android/inputmethodservice/KeyboardView.java b/core/java/android/inputmethodservice/KeyboardView.java index cecacaa..28a86b8 100755 --- a/core/java/android/inputmethodservice/KeyboardView.java +++ b/core/java/android/inputmethodservice/KeyboardView.java @@ -742,6 +742,10 @@ public class KeyboardView extends View implements View.OnClickListener { final Key key = keys[nearestKeyIndices[i]]; int dist = 0; boolean isInside = key.isInside(x,y); + if (isInside) { + primaryIndex = nearestKeyIndices[i]; + } + if (((mProximityCorrectOn && (dist = key.squaredDistanceFrom(x, y)) < mProximityThreshold) || isInside) @@ -770,10 +774,6 @@ public class KeyboardView extends View implements View.OnClickListener { } } } - - if (isInside) { - primaryIndex = nearestKeyIndices[i]; - } } if (primaryIndex == NOT_A_KEY) { primaryIndex = closestKey; |
