Skip to content
Snippets Groups Projects
Commit bd1cc1da authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

Fix bug that upper case mini-keyboard does not work

This issue is introduced by I1932b0a382e172cb77b9e098ae182049c834dfe0

Bug: 2993769
Change-Id: I344d21e046b58b3bb9831605a7425a94c97d8492
parent 12a4e08a
No related branches found
No related tags found
No related merge requests found
......@@ -41,19 +41,19 @@ class MiniKeyboardKeyDetector extends KeyDetector {
final Key[] keys = getKeys();
final int touchX = getTouchX(x);
final int touchY = getTouchY(y);
int closestKey = LatinKeyboardBaseView.NOT_A_KEY;
int closestKeyIndex = LatinKeyboardBaseView.NOT_A_KEY;
int closestKeyDist = (y < 0) ? mSlideAllowanceSquareTop : mSlideAllowanceSquare;
final int keyCount = keys.length;
for (int i = 0; i < keyCount; i++) {
final Key key = keys[i];
int dist = key.squaredDistanceFrom(touchX, touchY);
if (dist < closestKeyDist) {
closestKey = i;
closestKeyIndex = i;
closestKeyDist = dist;
}
}
if (allKeys != null && closestKey != LatinKeyboardBaseView.NOT_A_KEY)
allKeys[0] = closestKey;
return closestKey;
if (allKeys != null && closestKeyIndex != LatinKeyboardBaseView.NOT_A_KEY)
allKeys[0] = keys[closestKeyIndex].codes[0];
return closestKeyIndex;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment