Support desktop tasks in recents animation

Desktop tasks are using freeform windowing mode. Update recents
animation to support freeform tasks when desktop mode feature flag is
enabled.

Changes:
- set initial size for freeform tasks to be the size of the thumbnail
  instead of size of the screen
- support multiple individual remote animation targets when starting the
  recents animation

TODO:
- there are flickers when starting and ending the recents animation

Bug: 263264985
Test: swipe up when more than 1 desktop task is visible
Change-Id: I27ee02774281b3a433d779c0bb8825cdb6ea5457
This commit is contained in:
Ats Jenk
2023-01-17 09:41:10 -08:00
parent 196569bb50
commit 9db95e89b2
7 changed files with 134 additions and 10 deletions
@@ -127,6 +127,7 @@ import com.android.quickstep.util.SurfaceTransaction;
import com.android.quickstep.util.SurfaceTransactionApplier;
import com.android.quickstep.util.SwipePipToHomeAnimator;
import com.android.quickstep.util.TaskViewSimulator;
import com.android.quickstep.views.DesktopTaskView;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.TaskView;
import com.android.systemui.shared.recents.model.Task;
@@ -877,7 +878,11 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
public void onRecentsAnimationStart(RecentsAnimationController controller,
RecentsAnimationTargets targets) {
super.onRecentsAnimationStart(controller, targets);
mRemoteTargetHandles = mTargetGluer.assignTargetsForSplitScreen(mContext, targets);
if (DesktopTaskView.DESKTOP_MODE_SUPPORTED && targets.hasDesktopTasks()) {
mRemoteTargetHandles = mTargetGluer.assignTargetsForDesktop(targets);
} else {
mRemoteTargetHandles = mTargetGluer.assignTargetsForSplitScreen(mContext, targets);
}
mRecentsAnimationController = controller;
mRecentsAnimationTargets = targets;
mSwipePipToHomeReleaseCheck = new RemoteAnimationTargets.ReleaseCheck();