Using taskView simulator for animation a task to recentsView

Also applying transform params in DeviceLockedInputConsumer directly
instead of going through AppWindowAnimationHelper

Bug: 156398988
Bug: 155816922
Change-Id: I791e1a9feb07c4fb787130f8d040a4f404faf734
This commit is contained in:
Sunny Goyal committed 2020-05-15 14:07:29 -07:00
1 parent 9027a04514
commit b9abae9f0f
12 files changed
+158 -182

No files matched your search

@@ -18,6 +18,7 @@ package com.android.launcher3.anim;
import static com.android.launcher3.anim.AnimatorPlaybackController.addAnimationHoldersRecur;
import android.animation.Animator;
import android.animation.Animator.AnimatorListener;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.TimeInterpolator;
@@ -51,12 +52,8 @@ public class PendingAnimation implements PropertySetter {
private ValueAnimator mProgressAnimator;
public PendingAnimation(long duration) {
this(duration, new AnimatorSet());
}
public PendingAnimation(long duration, AnimatorSet targetSet) {
mDuration = duration;
mAnim = targetSet;
mAnim = new AnimatorSet();
}
/**
@@ -129,13 +126,32 @@ public class PendingAnimation implements PropertySetter {
public void addOnFrameCallback(Runnable runnable) {
if (mProgressAnimator == null) {
mProgressAnimator = ValueAnimator.ofFloat(0, 1).setDuration(mDuration);
add(mProgressAnimator);
}
mProgressAnimator.addUpdateListener(anim -> runnable.run());
}
public AnimatorSet getAnim() {
/**
* @see AnimatorSet#addListener(AnimatorListener)
*/
public void addListener(Animator.AnimatorListener listener) {
mAnim.addListener(listener);
}
/**
* Creates and returns the underlying AnimatorSet
*/
public AnimatorSet buildAnim() {
// Add progress animation to the end, so that frame callback is called after all the other
// animation update.
if (mProgressAnimator != null) {
add(mProgressAnimator);
mProgressAnimator = null;
}
if (mAnimHolders.isEmpty()) {
// Add a dummy animation to that the duration is respected
add(ValueAnimator.ofFloat(0, 1));
}
return mAnim;
}
@@ -143,7 +159,7 @@ public class PendingAnimation implements PropertySetter {
* Creates a controller for this animation
*/
public AnimatorPlaybackController createPlaybackController() {
return new AnimatorPlaybackController(mAnim, mDuration, mAnimHolders);
return new AnimatorPlaybackController(buildAnim(), mDuration, mAnimHolders);
}
/**