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

Commit 134ad6ef authored by Michael Kwan's avatar Michael Kwan
Browse files

Only modify window layout params when necessary.

Cancelling swipe-to-dismiss will trigger a check to ensure the window
is reset to its original state. Ensure that the reset is actually
required before setting the new layout attributes.

Bug: 34816397
Change-Id: Idf26ce7c8b63dc44a76effefcb32eb8d8665f605
parent c800ddc8
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -3016,11 +3016,15 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
                    @Override
                    public void onSwipeCancelled(SwipeDismissLayout layout) {
                        WindowManager.LayoutParams newParams = getAttributes();
                        // Swipe changes only affect the x-translation and alpha, check to see if
                        // those values have changed first before resetting them.
                        if (newParams.x != 0 || newParams.alpha != 1) {
                            newParams.x = 0;
                            newParams.alpha = 1;
                            setAttributes(newParams);
                            setFlags(FLAG_FULLSCREEN, FLAG_FULLSCREEN | FLAG_LAYOUT_NO_LIMITS);
                        }
                    }
                });
    }