Merge "Ensure that we're animating the current live tasks when going back" into tm-dev am: 3e6cd99990
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/18461390 Change-Id: Ic834d4d2458f2f3be7ff384b835d02b3dda1f343 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
e02cd37542
2 files changed
+75
-68
No files matched your search
@@ -133,7 +133,7 @@ public class OverviewState extends LauncherState {
|
|||||||
public void onBackPressed(Launcher launcher) {
|
public void onBackPressed(Launcher launcher) {
|
||||||
TaskView taskView = launcher.<RecentsView>getOverviewPanel().getRunningTaskView();
|
TaskView taskView = launcher.<RecentsView>getOverviewPanel().getRunningTaskView();
|
||||||
if (taskView != null) {
|
if (taskView != null) {
|
||||||
taskView.launchTaskAnimated();
|
taskView.launchTasks();
|
||||||
} else {
|
} else {
|
||||||
super.onBackPressed(launcher);
|
super.onBackPressed(launcher);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -618,73 +618,7 @@ public class TaskView extends FrameLayout implements Reusable {
|
|||||||
if (confirmSecondSplitSelectApp()) {
|
if (confirmSecondSplitSelectApp()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
RecentsView recentsView = getRecentsView();
|
launchTasks();
|
||||||
RemoteTargetHandle[] remoteTargetHandles = recentsView.mRemoteTargetHandles;
|
|
||||||
if (ENABLE_QUICKSTEP_LIVE_TILE.get() && isRunningTask() && remoteTargetHandles != null) {
|
|
||||||
if (!mIsClickableAsLiveTile) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reset the minimized state since we force-toggled the minimized state when entering
|
|
||||||
// overview, but never actually finished the recents animation
|
|
||||||
SystemUiProxy.INSTANCE.get(getContext()).setSplitScreenMinimized(false);
|
|
||||||
|
|
||||||
mIsClickableAsLiveTile = false;
|
|
||||||
RemoteAnimationTargets targets;
|
|
||||||
if (remoteTargetHandles.length == 1) {
|
|
||||||
targets = remoteTargetHandles[0].getTransformParams().getTargetSet();
|
|
||||||
} else {
|
|
||||||
TransformParams topLeftParams = remoteTargetHandles[0].getTransformParams();
|
|
||||||
TransformParams rightBottomParams = remoteTargetHandles[1].getTransformParams();
|
|
||||||
RemoteAnimationTargetCompat[] apps = Stream.concat(
|
|
||||||
Arrays.stream(topLeftParams.getTargetSet().apps),
|
|
||||||
Arrays.stream(rightBottomParams.getTargetSet().apps))
|
|
||||||
.toArray(RemoteAnimationTargetCompat[]::new);
|
|
||||||
RemoteAnimationTargetCompat[] wallpapers = Stream.concat(
|
|
||||||
Arrays.stream(topLeftParams.getTargetSet().wallpapers),
|
|
||||||
Arrays.stream(rightBottomParams.getTargetSet().wallpapers))
|
|
||||||
.toArray(RemoteAnimationTargetCompat[]::new);
|
|
||||||
targets = new RemoteAnimationTargets(apps, wallpapers,
|
|
||||||
topLeftParams.getTargetSet().nonApps,
|
|
||||||
topLeftParams.getTargetSet().targetMode);
|
|
||||||
}
|
|
||||||
if (targets == null) {
|
|
||||||
// If the recents animation is cancelled somehow between the parent if block and
|
|
||||||
// here, try to launch the task as a non live tile task.
|
|
||||||
launchTaskAnimated();
|
|
||||||
mIsClickableAsLiveTile = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
AnimatorSet anim = new AnimatorSet();
|
|
||||||
TaskViewUtils.composeRecentsLaunchAnimator(
|
|
||||||
anim, this, targets.apps,
|
|
||||||
targets.wallpapers, targets.nonApps, true /* launcherClosing */,
|
|
||||||
mActivity.getStateManager(), recentsView,
|
|
||||||
recentsView.getDepthController());
|
|
||||||
anim.addListener(new AnimatorListenerAdapter() {
|
|
||||||
@Override
|
|
||||||
public void onAnimationStart(Animator animation) {
|
|
||||||
recentsView.runActionOnRemoteHandles(
|
|
||||||
(Consumer<RemoteTargetHandle>) remoteTargetHandle ->
|
|
||||||
remoteTargetHandle
|
|
||||||
.getTaskViewSimulator()
|
|
||||||
.setDrawsBelowRecents(false));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAnimationEnd(Animator animator) {
|
|
||||||
if (mTask != null && mTask.key.displayId != getRootViewDisplayId()) {
|
|
||||||
launchTaskAnimated();
|
|
||||||
}
|
|
||||||
mIsClickableAsLiveTile = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
anim.start();
|
|
||||||
recentsView.onTaskLaunchedInLiveTileMode();
|
|
||||||
} else {
|
|
||||||
launchTaskAnimated();
|
|
||||||
}
|
|
||||||
mActivity.getStatsLogManager().logger().withItemInfo(getItemInfo())
|
mActivity.getStatsLogManager().logger().withItemInfo(getItemInfo())
|
||||||
.log(LAUNCHER_TASK_LAUNCH_TAP);
|
.log(LAUNCHER_TASK_LAUNCH_TAP);
|
||||||
}
|
}
|
||||||
@@ -781,6 +715,79 @@ public class TaskView extends FrameLayout implements Reusable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Launch of the current task (both live and inactive tasks) with an animation.
|
||||||
|
*/
|
||||||
|
public void launchTasks() {
|
||||||
|
RecentsView recentsView = getRecentsView();
|
||||||
|
RemoteTargetHandle[] remoteTargetHandles = recentsView.mRemoteTargetHandles;
|
||||||
|
if (ENABLE_QUICKSTEP_LIVE_TILE.get() && isRunningTask() && remoteTargetHandles != null) {
|
||||||
|
if (!mIsClickableAsLiveTile) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reset the minimized state since we force-toggled the minimized state when entering
|
||||||
|
// overview, but never actually finished the recents animation
|
||||||
|
SystemUiProxy.INSTANCE.get(getContext()).setSplitScreenMinimized(false);
|
||||||
|
|
||||||
|
mIsClickableAsLiveTile = false;
|
||||||
|
RemoteAnimationTargets targets;
|
||||||
|
if (remoteTargetHandles.length == 1) {
|
||||||
|
targets = remoteTargetHandles[0].getTransformParams().getTargetSet();
|
||||||
|
} else {
|
||||||
|
TransformParams topLeftParams = remoteTargetHandles[0].getTransformParams();
|
||||||
|
TransformParams rightBottomParams = remoteTargetHandles[1].getTransformParams();
|
||||||
|
RemoteAnimationTargetCompat[] apps = Stream.concat(
|
||||||
|
Arrays.stream(topLeftParams.getTargetSet().apps),
|
||||||
|
Arrays.stream(rightBottomParams.getTargetSet().apps))
|
||||||
|
.toArray(RemoteAnimationTargetCompat[]::new);
|
||||||
|
RemoteAnimationTargetCompat[] wallpapers = Stream.concat(
|
||||||
|
Arrays.stream(topLeftParams.getTargetSet().wallpapers),
|
||||||
|
Arrays.stream(rightBottomParams.getTargetSet().wallpapers))
|
||||||
|
.toArray(RemoteAnimationTargetCompat[]::new);
|
||||||
|
targets = new RemoteAnimationTargets(apps, wallpapers,
|
||||||
|
topLeftParams.getTargetSet().nonApps,
|
||||||
|
topLeftParams.getTargetSet().targetMode);
|
||||||
|
}
|
||||||
|
if (targets == null) {
|
||||||
|
// If the recents animation is cancelled somehow between the parent if block and
|
||||||
|
// here, try to launch the task as a non live tile task.
|
||||||
|
launchTaskAnimated();
|
||||||
|
mIsClickableAsLiveTile = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
AnimatorSet anim = new AnimatorSet();
|
||||||
|
TaskViewUtils.composeRecentsLaunchAnimator(
|
||||||
|
anim, this, targets.apps,
|
||||||
|
targets.wallpapers, targets.nonApps, true /* launcherClosing */,
|
||||||
|
mActivity.getStateManager(), recentsView,
|
||||||
|
recentsView.getDepthController());
|
||||||
|
anim.addListener(new AnimatorListenerAdapter() {
|
||||||
|
@Override
|
||||||
|
public void onAnimationStart(Animator animation) {
|
||||||
|
recentsView.runActionOnRemoteHandles(
|
||||||
|
(Consumer<RemoteTargetHandle>) remoteTargetHandle ->
|
||||||
|
remoteTargetHandle
|
||||||
|
.getTaskViewSimulator()
|
||||||
|
.setDrawsBelowRecents(false));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAnimationEnd(Animator animator) {
|
||||||
|
if (mTask != null && mTask.key.displayId != getRootViewDisplayId()) {
|
||||||
|
launchTaskAnimated();
|
||||||
|
}
|
||||||
|
mIsClickableAsLiveTile = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
anim.start();
|
||||||
|
recentsView.onTaskLaunchedInLiveTileMode();
|
||||||
|
} else {
|
||||||
|
launchTaskAnimated();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* See {@link TaskDataChanges}
|
* See {@link TaskDataChanges}
|
||||||
* @param visible If this task view will be visible to the user in overview or hidden
|
* @param visible If this task view will be visible to the user in overview or hidden
|
||||||
|
|||||||
Reference in new issue
Block a user