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

Commit ebbb72d7 authored by Kacper Kapłon's avatar Kacper Kapłon
Browse files

End ripple effect on maximized button when finished dragging

Fix: 346877247
Flag: com.android.window.flags.enable_app_header_with_task_density
Flag: com.android.window.flags.enable_themed_app_headers
Test: manual - verified the focus (ripple effect) disappear after
finished drag which started on maximized window button. Maximized button
remains functionable on long-press without drag.

Change-Id: I6f05cdc46f7aef98a856e3c39bf38f33ae1d2e4c
parent 6c943596
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -802,7 +802,6 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel,
        private boolean mIsResizeGesture;
        private boolean mIsDragging;
        private boolean mTouchscreenInUse;
        private boolean mHasLongClicked;
        private int mDragPointerId = -1;
        private MotionEvent mMotionEvent;

@@ -961,7 +960,6 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel,
                if (decoration.isMaximizeMenuActive()) {
                    decoration.closeMaximizeMenu();
                } else {
                    mHasLongClicked = true;
                    mDesktopModeUiEventLogger.log(decoration.mTaskInfo,
                            DesktopUiEventEnum.DESKTOP_WINDOW_MAXIMIZE_BUTTON_REVEAL_MENU);
                    decoration.createMaximizeMenu();
@@ -1068,7 +1066,6 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel,
                        updateDragStatus(e.getActionMasked());
                        mOnDragStartInitialBounds.set(initialBounds);
                    }
                    mHasLongClicked = false;
                    // Do not consume input event if a button is touched, otherwise it would
                    // prevent the button's ripple effect from showing.
                    return !touchingButton;
@@ -1123,7 +1120,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel,
                            newTaskBounds, decoration.calculateValidDragArea(),
                            new Rect(mOnDragStartInitialBounds), e,
                            mWindowDecorByTaskId.get(taskInfo.taskId));
                    if (touchingButton && !mHasLongClicked) {
                    if (touchingButton) {
                        // We need the input event to not be consumed here to end the ripple
                        // effect on the touched button. We will reset drag state in the ensuing
                        // onClick call that results.