Refactor TaskViewUtils to launch adjacent GroupedViewTaskView

* TaskViewUtils only used one TVS, now it can use
multiple necessary for staged split.
* Consolidate creating RemoteAnimationTargets into
TaskViewSimulators/TransformParams into RemoteTargetGluer

Test: Swipe to overview, tap on running task.
Swipe to overview, tap on adjacent task (single + split)
Bug: 195675206

Change-Id: I31e4aece60e2eaf94ce87ffc736b33fe7e0e5804
This commit is contained in:
Vinit Nayak
2021-08-19 13:31:50 -07:00
parent 11438429a8
commit 1409d29773
10 changed files with 371 additions and 274 deletions
@@ -91,7 +91,7 @@ import com.android.launcher3.util.TransformingTouchDelegate;
import com.android.launcher3.util.ViewPool.Reusable;
import com.android.quickstep.RecentsModel;
import com.android.quickstep.RemoteAnimationTargets;
import com.android.quickstep.SwipeUpAnimationLogic.RemoteTargetHandle;
import com.android.quickstep.RemoteTargetGluer.RemoteTargetHandle;
import com.android.quickstep.SystemUiProxy;
import com.android.quickstep.TaskIconCache;
import com.android.quickstep.TaskOverlayFactory;
@@ -592,6 +592,11 @@ public class TaskView extends FrameLayout implements Reusable {
return mSnapshotView;
}
/** TODO(b/197033698) Remove all usages of above method and migrate to this one */
public TaskThumbnailView[] getThumbnails() {
return new TaskThumbnailView[]{mSnapshotView};
}
public IconView getIconView() {
return mIconView;
}
@@ -618,13 +623,12 @@ public class TaskView extends FrameLayout implements Reusable {
mIsClickableAsLiveTile = false;
RecentsView recentsView = getRecentsView();
RemoteAnimationTargets targets;
RemoteTargetHandle[] remoteTargetHandles =
recentsView.mRemoteTargetHandles;
RemoteTargetHandle[] remoteTargetHandles = recentsView.mRemoteTargetHandles;
if (remoteTargetHandles.length == 1) {
targets = remoteTargetHandles[0].mTransformParams.getTargetSet();
targets = remoteTargetHandles[0].getTransformParams().getTargetSet();
} else {
TransformParams topLeftParams = remoteTargetHandles[0].mTransformParams;
TransformParams rightBottomParams = remoteTargetHandles[1].mTransformParams;
TransformParams topLeftParams = remoteTargetHandles[0].getTransformParams();
TransformParams rightBottomParams = remoteTargetHandles[1].getTransformParams();
RemoteAnimationTargetCompat[] apps = Stream.concat(
Arrays.stream(topLeftParams.getTargetSet().apps),
Arrays.stream(rightBottomParams.getTargetSet().apps))