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

Commit ba4b76b2 authored by Ben Lin's avatar Ben Lin
Browse files

PiP: When there's an animation happening, use animator's destBounds.

mLastReportedBounds from PipTaskOrganizer only gets updated when the
animation finishes. In the time #updateMovementBounds gets called while
there's another animation happening, using the animator's destination
bounds is a better choice.

Bug: 158225582
Test: Animation happens correctly now when shelf height change event
comes in at the same time as unexpand

Change-Id: I30f67327bb2c29f1ac5eae503cfd9d66b3f91928
parent 28a2e7fd
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -523,9 +523,19 @@ public class PipTaskOrganizer extends TaskOrganizer implements
                // this could happen if rotation finishes before the animation
                mLastReportedBounds.set(destinationBoundsOut);
                scheduleFinishResizePip(mLastReportedBounds);
            } else if (!mLastReportedBounds.isEmpty()) {
            } else  {
                // There could be an animation on-going. If there is one on-going, last-reported
                // bounds isn't yet updated. We'll use the animator's bounds instead.
                if (animator != null && animator.isRunning()) {
                    if (!animator.getDestinationBounds().isEmpty()) {
                        destinationBoundsOut.set(animator.getDestinationBounds());
                    }
                } else {
                    if (!mLastReportedBounds.isEmpty()) {
                        destinationBoundsOut.set(mLastReportedBounds);
                    }
                }
            }
            return;
        }