am 7bbea0dd: am 8d7ffcb2: Disable pop-up preview on mini keyboard

Merge commit '7bbea0dd8fe04b378a9a7a161c2995998f4a8dcf'

* commit '7bbea0dd8fe04b378a9a7a161c2995998f4a8dcf':
  Disable pop-up preview on mini keyboard
main
Tadashi G. Takaoka 2010-09-06 06:49:01 -07:00 committed by Android Git Automerger
commit 623818a8db
2 changed files with 2 additions and 19 deletions

View File

@ -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());

View File

@ -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);
}