Merge "Run animation for liveTile before trying to launch it" into tm-qpr-dev am: 7d8ba14b3c

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/19890490

Change-Id: Ia6a7f74c9a7ede2a41164fe68a271e94dcb7b724
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2022-09-12 19:59:16 +00:00
committed by Automerger Merge Worker
2 changed files with 17 additions and 5 deletions
@@ -144,7 +144,7 @@ public class OverviewCommandHelper {
RunnableList callbackList = null;
if (taskView != null) {
taskView.setEndQuickswitchCuj(true);
callbackList = taskView.launchTaskAnimated();
callbackList = taskView.launchTasks();
}
if (callbackList != null) {
@@ -689,12 +689,13 @@ public class TaskView extends FrameLayout implements Reusable {
/**
* Launch of the current task (both live and inactive tasks) with an animation.
*/
public void launchTasks() {
public RunnableList launchTasks() {
RecentsView recentsView = getRecentsView();
RemoteTargetHandle[] remoteTargetHandles = recentsView.mRemoteTargetHandles;
RunnableList runnableList = new RunnableList();
if (ENABLE_QUICKSTEP_LIVE_TILE.get() && isRunningTask() && remoteTargetHandles != null) {
if (!mIsClickableAsLiveTile) {
return;
return runnableList;
}
mIsClickableAsLiveTile = false;
@@ -721,7 +722,7 @@ public class TaskView extends FrameLayout implements Reusable {
// here, try to launch the task as a non live tile task.
launchTaskAnimated();
mIsClickableAsLiveTile = true;
return;
return runnableList;
}
AnimatorSet anim = new AnimatorSet();
@@ -746,13 +747,24 @@ public class TaskView extends FrameLayout implements Reusable {
launchTaskAnimated();
}
mIsClickableAsLiveTile = true;
runEndCallback();
}
@Override
public void onAnimationCancel(Animator animation) {
runEndCallback();
}
private void runEndCallback() {
runnableList.executeAllAndDestroy();
}
});
anim.start();
recentsView.onTaskLaunchedInLiveTileMode();
} else {
launchTaskAnimated();
return launchTaskAnimated();
}
return runnableList;
}
/**