Tune springs when app animates home into the hotseat on devices

with a taskbar.

Thought about using the Builder pattern here but the CL becomes
much larger due to SwipePipToHomeAnimator having its own
Builder.

Bug: 268026344
Test: swipe up to close app thats in hotseat
      swipe back to close app thats in hotseat

Change-Id: Idd0729224374579753fc91c7820f3b04a7d3e1a4
This commit is contained in:
Jon Miranda
2023-03-17 16:34:52 -07:00
parent 5b01486024
commit 18c53ac26b
8 changed files with 161 additions and 35 deletions

View File

@@ -136,6 +136,8 @@ import com.android.quickstep.SystemUiProxy;
import com.android.quickstep.TaskViewUtils;
import com.android.quickstep.util.MultiValueUpdateListener;
import com.android.quickstep.util.RectFSpringAnim;
import com.android.quickstep.util.RectFSpringAnim.DefaultSpringConfig;
import com.android.quickstep.util.RectFSpringAnim.TaskbarHotseatSpringConfig;
import com.android.quickstep.util.RemoteAnimationProvider;
import com.android.quickstep.util.StaggeredWorkspaceAnim;
import com.android.quickstep.util.SurfaceTransaction;
@@ -1342,6 +1344,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
}
// Get floating view and target rect.
boolean isInHotseat = false;
if (launcherView instanceof LauncherAppWidgetHostView) {
Size windowSize = new Size(mDeviceProfile.availableWidthPx,
mDeviceProfile.availableHeightPx);
@@ -1357,12 +1360,17 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
? null
: mLauncher.getTaskbarUIController().findMatchingView(launcherView),
true /* hideOriginal */, targetRect, false /* isOpening */);
isInHotseat = launcherView.getTag() instanceof ItemInfo
&& ((ItemInfo) launcherView.getTag()).isInHotseat();
} else {
targetRect.set(getDefaultWindowTargetRect());
}
RectFSpringAnim anim = new RectFSpringAnim(closingWindowStartRect, targetRect, mLauncher,
mDeviceProfile);
boolean useTaskbarHotseatParams = mDeviceProfile.isTaskbarPresent && isInHotseat;
RectFSpringAnim anim = new RectFSpringAnim(useTaskbarHotseatParams
? new TaskbarHotseatSpringConfig(mLauncher, closingWindowStartRect, targetRect)
: new DefaultSpringConfig(mLauncher, mDeviceProfile, closingWindowStartRect,
targetRect));
// Hook up floating views to the closing window animators.
final int rotationChange = getRotationChange(targets);