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

Commit 51aaeeb4 authored by Jorge Gil's avatar Jorge Gil Committed by Android (Google) Code Review
Browse files

Merge "Fix App Handle animation on cancelled drags" into main

parents 08027298 d3c38dc2
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -862,6 +862,15 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel {
                handleCaptionThroughStatusBar(e, decoration);
                final boolean wasDragging = mIsDragging;
                updateDragStatus(e.getActionMasked());
                final boolean upOrCancel = e.getActionMasked() == ACTION_UP
                        || e.getActionMasked() == ACTION_CANCEL;
                if (wasDragging && upOrCancel) {
                    // When finishing a drag the event will be consumed, which means the pressed
                    // state of the App Handle must be manually reset to scale its drawable back to
                    // its original shape. This is necessary for drag gestures of the Handle that
                    // result in a cancellation (dragging back to the top).
                    v.setPressed(false);
                }
                // Only prevent onClick from receiving this event if it's a drag.
                return wasDragging;
            }