Fix logic around launchTask in the live tile case
When how things are structured changed in the past 1-2 releases, we have dup logic in launchTask. There are two cases - Swipe down from Overview: RecentsView#createTaskLaunchAnimation. In endListener, call launchTask in the non live tile case, and call finishRecentsAnimation in the live tile case - Tap on the TaskView to launch task: In the non live tile case, call launchTask as it calls startActivity with option. In the live tile, currently we call createLaunchAnimationForRunningTask, which plays the task launch animation, which calls finishRecentsAnimation at the end. But this animation is not sufficient, when the user swipes the live tile task off to the right and tries to launch it. We will need to replace this animation with createRecentsWindowAnimator Fixes: 169516051 Test: manual Change-Id: Id764d6787175bcdb1c82adb8e4743af192a1fd9d
This commit is contained in:
1 parent
cc7b860566
commit
c8cbd822b5
2 files changed
+8
-19
No files matched your search
@@ -217,6 +217,7 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
|
||||
}
|
||||
if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
|
||||
if (isRunningTask()) {
|
||||
// TODO: Replace this animation with createRecentsWindowAnimator
|
||||
createLaunchAnimationForRunningTask().start();
|
||||
} else {
|
||||
launchTask(true /* animate */);
|
||||
@@ -364,10 +365,7 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
|
||||
final PendingAnimation pendingAnimation = getRecentsView().createTaskLaunchAnimation(
|
||||
this, RECENTS_LAUNCH_DURATION, TOUCH_RESPONSE_INTERPOLATOR);
|
||||
AnimatorPlaybackController currentAnimation = pendingAnimation.createPlaybackController();
|
||||
currentAnimation.setEndAction(() -> {
|
||||
pendingAnimation.finish(true);
|
||||
launchTask(false);
|
||||
});
|
||||
currentAnimation.setEndAction(() -> pendingAnimation.finish(true));
|
||||
return currentAnimation;
|
||||
}
|
||||
|
||||
@@ -390,20 +388,6 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
|
||||
|
||||
public void launchTask(boolean animate, boolean freezeTaskList, Consumer<Boolean> resultCallback,
|
||||
Handler resultCallbackHandler) {
|
||||
if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
|
||||
if (isRunningTask()) {
|
||||
getRecentsView().finishRecentsAnimation(false /* toRecents */,
|
||||
() -> resultCallbackHandler.post(() -> resultCallback.accept(true)));
|
||||
} else {
|
||||
launchTaskInternal(animate, freezeTaskList, resultCallback, resultCallbackHandler);
|
||||
}
|
||||
} else {
|
||||
launchTaskInternal(animate, freezeTaskList, resultCallback, resultCallbackHandler);
|
||||
}
|
||||
}
|
||||
|
||||
private void launchTaskInternal(boolean animate, boolean freezeTaskList,
|
||||
Consumer<Boolean> resultCallback, Handler resultCallbackHandler) {
|
||||
if (mTask != null) {
|
||||
final ActivityOptions opts;
|
||||
TestLogging.recordEvent(
|
||||
|
||||
Reference in new issue
Block a user