Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7bbea0dd authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka Committed by Android Git Automerger
Browse files

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

Merge commit '8d7ffcb2' into gingerbread-plus-aosp

* commit '8d7ffcb2':
  Disable pop-up preview on mini keyboard
parents efe7abe0 8d7ffcb2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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());
+0 −18
Original line number Diff line number Diff line
@@ -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);
        }