am 2b38b5e8: [IL62] Pull up X,Y processing, step 1

* commit '2b38b5e8e60900e45a9d5d591ba6f7f7788e535c':
  [IL62] Pull up X,Y processing, step 1
main
Jean Chalard 2014-01-22 01:36:30 -08:00 committed by Android Git Automerger
commit 992d020c87
1 changed files with 9 additions and 8 deletions

View File

@ -475,9 +475,15 @@ public final class InputLogic {
} }
final int keyX, keyY; final int keyX, keyY;
final Keyboard keyboard = keyboardSwitcher.getKeyboard(); final Keyboard keyboard = keyboardSwitcher.getKeyboard();
final MainKeyboardView mainKeyboardView = keyboardSwitcher.getMainKeyboardView();
// TODO: We should reconsider which coordinate system should be used to represent
// keyboard event.
if (keyboard != null && keyboard.hasProximityCharsCorrection(codePoint)) { if (keyboard != null && keyboard.hasProximityCharsCorrection(codePoint)) {
keyX = x; // x and y include some padding, but everything down the line (especially native
keyY = y; // code) needs the coordinates in the keyboard frame.
// TODO: move this frame change up
keyX = mainKeyboardView.getKeyX(x);
keyY = mainKeyboardView.getKeyY(y);
} else { } else {
keyX = Constants.NOT_A_COORDINATE; keyX = Constants.NOT_A_COORDINATE;
keyY = Constants.NOT_A_COORDINATE; keyY = Constants.NOT_A_COORDINATE;
@ -549,12 +555,7 @@ public final class InputLogic {
resetComposingState(false /* alsoResetLastComposedWord */); resetComposingState(false /* alsoResetLastComposedWord */);
} }
if (isComposingWord) { if (isComposingWord) {
final MainKeyboardView mainKeyboardView = keyboardSwitcher.getMainKeyboardView(); mWordComposer.add(codePoint, x, y);
// TODO: We should reconsider which coordinate system should be used to represent
// keyboard event.
final int keyX = mainKeyboardView.getKeyX(x);
final int keyY = mainKeyboardView.getKeyY(y);
mWordComposer.add(codePoint, keyX, keyY);
// If it's the first letter, make note of auto-caps state // If it's the first letter, make note of auto-caps state
if (mWordComposer.size() == 1) { if (mWordComposer.size() == 1) {
// We pass 1 to getPreviousWordForSuggestion because we were not composing a word // We pass 1 to getPreviousWordForSuggestion because we were not composing a word