aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinKeyboardView.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2010-11-23 17:55:22 -0800
committerTadashi G. Takaoka <takaoka@google.com>2010-11-24 00:16:00 -0800
commit2c60d6e28ecf7d6f7e97a504ebfa97e286d931ed (patch)
tree675324b2b2a854aa3c974bf02834074df57739b3 /java/src/com/android/inputmethod/latin/LatinKeyboardView.java
parent6624fd873681160295fe4475aff54512ca905b98 (diff)
downloadlatinime-2c60d6e28ecf7d6f7e97a504ebfa97e286d931ed.tar.gz
latinime-2c60d6e28ecf7d6f7e97a504ebfa97e286d931ed.tar.xz
latinime-2c60d6e28ecf7d6f7e97a504ebfa97e286d931ed.zip
Support dedicated number/date keyboard layout
Bug: 3009716 Change-Id: Idc12cc9d8ee4f5febfae4e11712e2aaca327a6ea
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinKeyboardView.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinKeyboardView.java14
1 files changed, 5 insertions, 9 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboardView.java b/java/src/com/android/inputmethod/latin/LatinKeyboardView.java
index fb8b69ed0..4fcfe01ba 100644
--- a/java/src/com/android/inputmethod/latin/LatinKeyboardView.java
+++ b/java/src/com/android/inputmethod/latin/LatinKeyboardView.java
@@ -40,8 +40,6 @@ public class LatinKeyboardView extends BaseKeyboardView {
public static final int KEYCODE_PREV_LANGUAGE = -105;
public static final int KEYCODE_CAPSLOCK = -106;
- private LatinKeyboard mPhoneKeyboard;
-
/** Whether we've started dropping move events because we found a big jump */
private boolean mDroppingEvents;
/**
@@ -62,14 +60,12 @@ public class LatinKeyboardView extends BaseKeyboardView {
super(context, attrs, defStyle);
}
- public void setPhoneKeyboard(LatinKeyboard phoneKeyboard) {
- mPhoneKeyboard = phoneKeyboard;
- }
-
@Override
public void setPreviewEnabled(boolean previewEnabled) {
- if (getLatinKeyboard() == mPhoneKeyboard) {
- // Phone keyboard never shows popup preview (except language switch).
+ LatinKeyboard latinKeyboard = getLatinKeyboard();
+ if (latinKeyboard != null
+ && (latinKeyboard.isPhoneKeyboard() || latinKeyboard.isNumberKeyboard())) {
+ // Phone and number keyboard never shows popup preview (except language switch).
super.setPreviewEnabled(false);
} else {
super.setPreviewEnabled(previewEnabled);
@@ -100,7 +96,7 @@ public class LatinKeyboardView extends BaseKeyboardView {
int primaryCode = key.codes[0];
if (primaryCode == KEYCODE_OPTIONS) {
return invokeOnKey(KEYCODE_OPTIONS_LONGPRESS);
- } else if (primaryCode == '0' && getLatinKeyboard() == mPhoneKeyboard) {
+ } else if (primaryCode == '0' && getLatinKeyboard().isPhoneKeyboard()) {
// Long pressing on 0 in phone number keypad gives you a '+'.
return invokeOnKey('+');
} else {