summaryrefslogtreecommitdiff
path: root/java/src/com/android/inputmethod/keyboard/LatinKey.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/LatinKey.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/LatinKey.java')
-rw-r--r--java/src/com/android/inputmethod/keyboard/LatinKey.java54
1 files changed, 3 insertions, 51 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/LatinKey.java b/java/src/com/android/inputmethod/keyboard/LatinKey.java
index 4eaf4c8f6..1df4227ae 100644
--- a/java/src/com/android/inputmethod/keyboard/LatinKey.java
+++ b/java/src/com/android/inputmethod/keyboard/LatinKey.java
@@ -19,47 +19,11 @@ package com.android.inputmethod.keyboard;
import android.content.res.Resources;
import android.content.res.XmlResourceParser;
+// TODO: We should remove this class
public class LatinKey extends Key {
-
- // functional normal state (with properties)
- private final int[] KEY_STATE_FUNCTIONAL_NORMAL = {
- android.R.attr.state_single
- };
-
- // functional pressed state (with properties)
- private final int[] KEY_STATE_FUNCTIONAL_PRESSED = {
- android.R.attr.state_single,
- android.R.attr.state_pressed
- };
-
- private boolean mShiftLockEnabled;
-
public LatinKey(Resources res, Row parent, int x, int y,
XmlResourceParser parser, KeyStyles keyStyles) {
super(res, parent, x, y, parser, keyStyles);
- if (popupCharacters != null && popupCharacters.length() == 0) {
- // If there is a keyboard with no keys specified in popupCharacters
- popupResId = 0;
- }
- }
-
- void enableShiftLock() {
- mShiftLockEnabled = true;
- }
-
- // sticky is used for shift key. If a key is not sticky and is modifier,
- // the key will be treated as functional.
- private boolean isFunctionalKey() {
- return !sticky && modifier;
- }
-
- @Override
- public void onReleased(boolean inside) {
- if (!mShiftLockEnabled) {
- super.onReleased(inside);
- } else {
- pressed = !pressed;
- }
}
/**
@@ -67,24 +31,12 @@ public class LatinKey extends Key {
*/
@Override
public boolean isInside(int x, int y) {
- boolean result = (keyboard instanceof LatinKeyboard)
- && ((LatinKeyboard)keyboard).isInside(this, x, y);
+ boolean result = (mKeyboard instanceof LatinKeyboard)
+ && ((LatinKeyboard)mKeyboard).isInside(this, x, y);
return result;
}
boolean isInsideSuper(int x, int y) {
return super.isInside(x, y);
}
-
- @Override
- public int[] getCurrentDrawableState() {
- if (isFunctionalKey()) {
- if (pressed) {
- return KEY_STATE_FUNCTIONAL_PRESSED;
- } else {
- return KEY_STATE_FUNCTIONAL_NORMAL;
- }
- }
- return super.getCurrentDrawableState();
- }
}