From 8d7ffcb2ac3a8cdd051c7e493ff17b6bf1ded9c0 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Mon, 6 Sep 2010 22:16:11 +0900 Subject: [PATCH] Disable pop-up preview on mini keyboard This change also disable the special behavior of long press a key that has only one digit alternate. If the visual design of both the pop-up preview and the mini keyboard will look like same, I think that showing mini keyboard is enough for the key that has one digit alternate. Bug: 2973546 Change-Id: I04f138c120aa58526fe054626dac856171fb7a58 --- .../latin/LatinKeyboardBaseView.java | 3 ++- .../inputmethod/latin/LatinKeyboardView.java | 18 ------------------ 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java b/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java index 51bdc2c0c..1e95e8ac4 100644 --- a/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java +++ b/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java @@ -1073,7 +1073,8 @@ public class LatinKeyboardBaseView extends View implements PointerTracker.UIProx mMiniKeyboardOriginY = y + container.getPaddingTop(); mMiniKeyboard.setPopupOffset((x < 0) ? 0 : x, y); mMiniKeyboard.setShifted(isShifted()); - mMiniKeyboard.setPreviewEnabled(isPreviewEnabled()); + // Mini keyboard needs no pop-up key preview displayed. + mMiniKeyboard.setPreviewEnabled(false); mMiniKeyboardPopup.setContentView(container); mMiniKeyboardPopup.setWidth(container.getMeasuredWidth()); mMiniKeyboardPopup.setHeight(container.getMeasuredHeight()); diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboardView.java b/java/src/com/android/inputmethod/latin/LatinKeyboardView.java index 4295427e3..8f20a22d0 100644 --- a/java/src/com/android/inputmethod/latin/LatinKeyboardView.java +++ b/java/src/com/android/inputmethod/latin/LatinKeyboardView.java @@ -78,17 +78,6 @@ public class LatinKeyboardView extends LatinKeyboardBaseView { setKeyboardLocal(k); } - private static boolean hasOneDigitAlternate(Key key) { - final CharSequence alternates = key.popupCharacters; - if (alternates == null) - return false; - final String altChars = alternates.toString(); - if (altChars.codePointCount(0, altChars.length()) != 1) - return false; - final int altCode = altChars.codePointAt(0); - return altCode >= '0' && altCode <= '9'; - } - @Override protected boolean onLongPress(Key key) { int primaryCode = key.codes[0]; @@ -104,13 +93,6 @@ public class LatinKeyboardView extends LatinKeyboardBaseView { LatinKeyboardBaseView.NOT_A_TOUCH_COORDINATE, LatinKeyboardBaseView.NOT_A_TOUCH_COORDINATE); return true; - } else if (hasOneDigitAlternate(key)) { - mKeyCodes[0] = primaryCode = key.popupCharacters.charAt(0); - // when there is only one alternate character, send it as key action. - getOnKeyboardActionListener().onKey(primaryCode, mKeyCodes, - LatinKeyboardBaseView.NOT_A_TOUCH_COORDINATE, - LatinKeyboardBaseView.NOT_A_TOUCH_COORDINATE); - return true; } else { return super.onLongPress(key); }