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

Commit d3c38dc2 authored by Jorge Gil's avatar Jorge Gil
Browse files

Fix App Handle animation on cancelled drags

Ensures that the pressed state of the app handle is reset manually when
finishing a drag gesture. On drag-to-cancel cases, the App Handle
remains visible and needs to be set to unpressed manually because the
custom touch handler will consume the event (primarily to prevent
clicks).

Flag: EXEMPT bugfix
Fix: 367346098
Test: drag from app handle and release back in the fullscreen region,
verify the handle animated back to its full scale.

Change-Id: I94f15e024b630ce0e4d5b74203259925cd348178
parent d09a2578
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -860,6 +860,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;
            }