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

Commit 6b0bcfba authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka Committed by Android (Google) Code Review
Browse files

Merge "Disable long press timer while sliding input mode"

parents ad662ade 43ad100d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ public class Key implements Comparable<Key> {
    /** Hit bounding box of the key */
    public final Rect mHitBox = new Rect();

    /** More keys */
    /** More keys. It is guaranteed that this is null or an array of one or more elements */
    public final MoreKeySpec[] mMoreKeys;
    /** More keys column number and flags */
    private final int mMoreKeysColumnAndFlags;
+1 −1
Original line number Diff line number Diff line
@@ -497,7 +497,7 @@ public class KeyboardView extends View {
            }
        }

        if (key.hasPopupHint() && key.mMoreKeys != null && key.mMoreKeys.length > 0) {
        if (key.hasPopupHint() && key.mMoreKeys != null) {
            drawKeyPopupHint(key, canvas, paint, params);
        }
    }
+9 −3
Original line number Diff line number Diff line
@@ -1306,10 +1306,16 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
    }

    private void startLongPressTimer(final Key key) {
        if (key != null && key.isLongPressEnabled() && !sInGesture) {
        if (sInGesture) return;
        if (key == null) return;
        if (!key.isLongPressEnabled()) return;
        // Caveat: Please note that isLongPressEnabled() can be true even if the current key
        // doesn't have its more keys. (e.g. spacebar, globe key)
        // We always need to start the long press timer if the key has its more keys regardless of
        // whether or not we are in the sliding input mode.
        if (mIsInSlidingKeyInputFromModifier && key.mMoreKeys == null) return;
        mTimerProxy.startLongPressTimer(this);
    }
    }

    private void detectAndSendKey(final Key key, final int x, final int y, final long eventTime) {
        if (key == null) {