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

Commit 62a8b61f authored by Alan Viverette's avatar Alan Viverette
Browse files

Manage pressed state during drag-to-open

BUG: 17573390
Change-Id: Ia85d7b51d6e4a18dcbf99b930f9f7c045697a31b
parent 3867e4d0
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -1639,6 +1639,11 @@ public class ListPopupWindow {
            setPressed(false);
            updateSelectorState();

            final View motionView = getChildAt(mMotionPosition - mFirstPosition);
            if (motionView != null) {
                motionView.setPressed(false);
            }

            if (mClickAnimation != null) {
                mClickAnimation.cancel();
                mClickAnimation = null;
@@ -1653,6 +1658,15 @@ public class ListPopupWindow {
            setPressed(true);
            layoutChildren();

            // Manage the pressed view based on motion position. This allows us to
            // play nicely with actual touch and scroll events.
            final View motionView = getChildAt(mMotionPosition - mFirstPosition);
            if (motionView != null) {
                motionView.setPressed(false);
            }
            mMotionPosition = position;
            child.setPressed(true);

            // Ensure that keyboard focus starts from the last touched position.
            setSelectedPositionInt(position);
            positionSelectorLikeTouch(position, child, x, y);