diff options
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinKeyboardView.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinKeyboardView.java | 14 |
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 { |