From f7b4e7f497437d8ce1df1632bba6dee7b61298c8 Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Wed, 25 May 2022 16:42:49 -0700 Subject: Limit starting bounds of swipe to animation start rect * If the starting point is greater than that of the current device's width (in either positive or negative direction), reset the starting rect to be fullscreen task bounds * More details at b/228829958#comment12 Fixes: 228829958 Test: Reboot device and swipe up from home immediately, app doesn't fling from the side. Tested with portrait and landscape launcher. Tested with fake landscape launcher. Change-Id: I6ea24e30e9de5716b7830f487b2ed63f56598c50 --- quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'quickstep/src') diff --git a/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java b/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java index 088e1cfc00..966710854f 100644 --- a/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java +++ b/quickstep/src/com/android/quickstep/SwipeUpAnimationLogic.java @@ -266,6 +266,13 @@ public abstract class SwipeUpAnimationLogic implements RectF cropRectF = new RectF(taskViewSimulator.getCurrentCropRect()); // Move the startRect to Launcher space as floatingIconView runs in Launcher Matrix windowToHomePositionMap = new Matrix(); + + // If the start rect ends up overshooting too much to the left/right offscreen, bring it + // back to fullscreen. This can happen when the recentsScroll value isn't aligned with + // the pageScroll value for a given taskView, see b/228829958#comment12 + mRemoteTargetHandles[0].getTaskViewSimulator().getOrientationState().getOrientationHandler() + .fixBoundsForHomeAnimStartRect(startRect, mDp); + homeToWindowPositionMap.invert(windowToHomePositionMap); windowToHomePositionMap.mapRect(startRect); -- cgit v1.2.3