Fix weird task launch animation am: e1ce26e70c
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14205571 Change-Id: I5074c3d3432f2cc05e36bf5befd1c64bfa7078ab
This commit is contained in:
@@ -500,23 +500,25 @@ public final class TaskViewUtils {
|
||||
windowAnimEndListener = new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
recentsView.post(() -> {
|
||||
stateManager.moveToRestState();
|
||||
stateManager.reapplyState();
|
||||
recentsView.finishRecentsAnimation(false /* toRecents */, () -> {
|
||||
recentsView.post(() -> {
|
||||
stateManager.moveToRestState();
|
||||
stateManager.reapplyState();
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
} else {
|
||||
AnimatorPlaybackController controller =
|
||||
stateManager.createAnimationToNewWorkspace(NORMAL,
|
||||
RECENTS_LAUNCH_DURATION);
|
||||
stateManager.createAnimationToNewWorkspace(NORMAL, RECENTS_LAUNCH_DURATION);
|
||||
controller.dispatchOnStart();
|
||||
childStateAnimation = controller.getTarget();
|
||||
launcherAnim = controller.getAnimationPlayer().setDuration(RECENTS_LAUNCH_DURATION);
|
||||
windowAnimEndListener = new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
stateManager.goToState(NORMAL, false);
|
||||
recentsView.finishRecentsAnimation(false /* toRecents */,
|
||||
() -> stateManager.goToState(NORMAL, false));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -137,7 +137,6 @@ import com.android.quickstep.TaskOverlayFactory;
|
||||
import com.android.quickstep.TaskThumbnailCache;
|
||||
import com.android.quickstep.TaskViewUtils;
|
||||
import com.android.quickstep.ViewUtils;
|
||||
import com.android.quickstep.util.ActiveGestureLog;
|
||||
import com.android.quickstep.util.LayoutUtils;
|
||||
import com.android.quickstep.util.MultiValueUpdateListener;
|
||||
import com.android.quickstep.util.RecentsOrientedState;
|
||||
@@ -760,6 +759,12 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
}
|
||||
});
|
||||
anim.play(appAnimator);
|
||||
anim.addListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
finishRecentsAnimation(true /* toRecents */, null);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
TaskViewUtils.composeRecentsLaunchAnimator(
|
||||
anim, taskView, apps,
|
||||
@@ -768,30 +773,6 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
mActivity.getStateManager(), this,
|
||||
getDepthController());
|
||||
}
|
||||
anim.addListener(new AnimatorListenerAdapter(){
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animator) {
|
||||
cleanUp(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationCancel(Animator animator) {
|
||||
cleanUp(true);
|
||||
}
|
||||
|
||||
private void cleanUp(boolean canceled) {
|
||||
if (mRecentsAnimationController != null) {
|
||||
finishRecentsAnimation(false /* toRecents */, null /* onFinishComplete */);
|
||||
if (canceled) {
|
||||
mRecentsAnimationController = null;
|
||||
} else {
|
||||
mSizeStrategy.onLaunchTaskSuccess();
|
||||
}
|
||||
ActiveGestureLog.INSTANCE.addLog("finishRecentsAnimation", false);
|
||||
}
|
||||
}
|
||||
});
|
||||
anim.start();
|
||||
}
|
||||
|
||||
@@ -1441,6 +1422,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
|
||||
mRecentsAnimationController = null;
|
||||
mLiveTileParams.setTargetSet(null);
|
||||
mLiveTileTaskViewSimulator.setDrawsBelowRecents(true);
|
||||
|
||||
unloadVisibleTaskData(TaskView.FLAG_UPDATE_ALL);
|
||||
setCurrentPage(0);
|
||||
@@ -3078,6 +3060,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
}
|
||||
|
||||
mRecentsAnimationController.finish(toRecents, () -> {
|
||||
mRecentsAnimationController = null;
|
||||
if (onFinishComplete != null) {
|
||||
onFinishComplete.run();
|
||||
}
|
||||
|
||||
@@ -484,7 +484,6 @@ public class TaskView extends FrameLayout implements Reusable {
|
||||
mIsClickableAsLiveTile = false;
|
||||
RecentsView recentsView = getRecentsView();
|
||||
RemoteAnimationTargets targets = recentsView.getLiveTileParams().getTargetSet();
|
||||
recentsView.getLiveTileTaskViewSimulator().setDrawsBelowRecents(false);
|
||||
|
||||
AnimatorSet anim = new AnimatorSet();
|
||||
TaskViewUtils.composeRecentsLaunchAnimator(
|
||||
@@ -493,10 +492,13 @@ public class TaskView extends FrameLayout implements Reusable {
|
||||
mActivity.getStateManager(), recentsView,
|
||||
recentsView.getDepthController());
|
||||
anim.addListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationStart(Animator animator) {
|
||||
recentsView.getLiveTileTaskViewSimulator().setDrawsBelowRecents(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animator) {
|
||||
recentsView.getLiveTileTaskViewSimulator().setDrawsBelowRecents(true);
|
||||
recentsView.finishRecentsAnimation(false, null);
|
||||
mIsClickableAsLiveTile = true;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user