summaryrefslogtreecommitdiff
path: root/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2010-12-02 20:54:32 +0900
committerTadashi G. Takaoka <takaoka@google.com>2010-12-02 23:03:59 +0900
commit571bdb401f670b92bd7710a12a990cb65a99b7d3 (patch)
treeb0d50937339cfea2caca8311dd2c0d5b4ec82e5d /java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java
parent26dae3f4e8ffd0f25b78c58598752cd393419bcc (diff)
Refactor LatinKeyboard and LatinKey
This change also moves KeyboardSwitcher and related classes to com.android.inputmethod.keyboard package. Multi project change with Ib23017b2 Change-Id: Id7d54b24615fe22ebb540ca847549909e346ee24
Diffstat (limited to 'java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java')
-rw-r--r--java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java19
1 files changed, 10 insertions, 9 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java
index 55427d23f..4e0caa1f6 100644
--- a/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/LatinKeyboardView.java
@@ -31,6 +31,7 @@ import android.view.MotionEvent;
import java.util.List;
+// TODO: We should remove this class
public class LatinKeyboardView extends KeyboardView {
/** Whether we've started dropping move events because we found a big jump */
@@ -86,9 +87,9 @@ public class LatinKeyboardView extends KeyboardView {
@Override
protected boolean onLongPress(Key key) {
- int primaryCode = key.codes[0];
- if (primaryCode == LatinKeyboard.KEYCODE_OPTIONS) {
- return invokeOnKey(LatinKeyboard.KEYCODE_OPTIONS_LONGPRESS);
+ int primaryCode = key.mCodes[0];
+ if (primaryCode == Keyboard.CODE_OPTIONS) {
+ return invokeOnKey(Keyboard.CODE_OPTIONS_LONGPRESS);
} else if (primaryCode == '0' && getLatinKeyboard().isPhoneKeyboard()) {
// Long pressing on 0 in phone number keypad gives you a '+'.
return invokeOnKey('+');
@@ -216,7 +217,7 @@ public class LatinKeyboardView extends KeyboardView {
if (languageDirection != 0) {
getOnKeyboardActionListener().onKey(
languageDirection == 1
- ? LatinKeyboard.KEYCODE_NEXT_LANGUAGE : LatinKeyboard.KEYCODE_PREV_LANGUAGE,
+ ? Keyboard.CODE_NEXT_LANGUAGE : Keyboard.CODE_PREV_LANGUAGE,
null, mLastX, mLastY);
me.setAction(MotionEvent.ACTION_CANCEL);
keyboard.keyReleased();
@@ -271,8 +272,8 @@ public class LatinKeyboardView extends KeyboardView {
}
c = mStringToPlay.charAt(mStringIndex);
}
- int x = mAsciiKeys[c].x + 10;
- int y = mAsciiKeys[c].y + 26;
+ int x = mAsciiKeys[c].mX + 10;
+ int y = mAsciiKeys[c].mY + 26;
MotionEvent me = MotionEvent.obtain(SystemClock.uptimeMillis(),
SystemClock.uptimeMillis(),
MotionEvent.ACTION_DOWN, x, y, 0);
@@ -284,8 +285,8 @@ public class LatinKeyboardView extends KeyboardView {
break;
case MSG_TOUCH_UP:
char cUp = mStringToPlay.charAt(mStringIndex);
- int x2 = mAsciiKeys[cUp].x + 10;
- int y2 = mAsciiKeys[cUp].y + 26;
+ int x2 = mAsciiKeys[cUp].mX + 10;
+ int y2 = mAsciiKeys[cUp].mY + 26;
mStringIndex++;
MotionEvent me2 = MotionEvent.obtain(SystemClock.uptimeMillis(),
@@ -309,7 +310,7 @@ public class LatinKeyboardView extends KeyboardView {
List<Key> keys = getLatinKeyboard().getKeys();
// Get the keys on this keyboard
for (int i = 0; i < keys.size(); i++) {
- int code = keys.get(i).codes[0];
+ int code = keys.get(i).mCodes[0];
if (code >= 0 && code <= 255) {
mAsciiKeys[code] = keys.get(i);
}