From f8acb23e1f6252a00710eeb8f620dd289145ad6d Mon Sep 17 00:00:00 2001 From: Sihua Ma Date: Tue, 16 May 2023 14:48:59 -0700 Subject: [PATCH] Fix widget clipping in widget back animation Test: Manual Fix: 280261814 Change-Id: I4db24ca624d50b1d860df428fdab9d591f35ac5e --- .../com/android/quickstep/LauncherSwipeHandlerV2.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java b/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java index 43ad175b6f..fd5c1a7a78 100644 --- a/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java +++ b/quickstep/src/com/android/quickstep/LauncherSwipeHandlerV2.java @@ -47,6 +47,7 @@ import com.android.launcher3.views.FloatingView; import com.android.launcher3.widget.LauncherAppWidgetHostView; import com.android.quickstep.util.RectFSpringAnim; import com.android.quickstep.util.StaggeredWorkspaceAnim; +import com.android.quickstep.util.TaskViewSimulator; import com.android.quickstep.views.FloatingWidgetView; import com.android.quickstep.views.RecentsView; import com.android.quickstep.views.TaskView; @@ -160,13 +161,16 @@ public class LauncherSwipeHandlerV2 extends Rect crop = new Rect(); // We can assume there is only one remote target here because staged split never animates // into the app icon, only into the homescreen - mRemoteTargetHandles[0].getTaskViewSimulator().getCurrentCropRect().roundOut(crop); + RemoteTargetGluer.RemoteTargetHandle remoteTargetHandle = mRemoteTargetHandles[0]; + TaskViewSimulator tvs = remoteTargetHandle.getTaskViewSimulator(); + // This is to set up the inverse matrix in the simulator + tvs.apply(remoteTargetHandle.getTransformParams()); + tvs.getCurrentCropRect().roundOut(crop); Size windowSize = new Size(crop.width(), crop.height()); int fallbackBackgroundColor = FloatingWidgetView.getDefaultBackgroundColor(mContext, runningTaskTarget); FloatingWidgetView floatingWidgetView = FloatingWidgetView.getFloatingWidgetView(mActivity, - hostView, backgroundLocation, windowSize, - mRemoteTargetHandles[0].getTaskViewSimulator().getCurrentCornerRadius(), + hostView, backgroundLocation, windowSize, tvs.getCurrentCornerRadius(), isTargetTranslucent, fallbackBackgroundColor); return new FloatingViewHomeAnimationFactory(floatingWidgetView) {