Merge "Start collecting task dismiss CUJ on dismiss animation start." into main
This commit is contained in:
commit
caa9404aa0
2 files changed
+23
-7
No files matched your search
@@ -4016,6 +4016,10 @@ public abstract class RecentsView<
|
||||
dismissedTaskView.setTranslationZ(0.1f);
|
||||
}
|
||||
loadVisibleTaskData(TaskView.FLAG_UPDATE_ALL);
|
||||
if (!dismissingForSplitSelection) {
|
||||
anim.addStartListener(() -> InteractionJankMonitorWrapper.begin(this,
|
||||
Cuj.CUJ_LAUNCHER_OVERVIEW_TASK_DISMISS));
|
||||
}
|
||||
mPendingAnimation = anim;
|
||||
final TaskView finalNextFocusedTaskView = nextFocusedTaskView;
|
||||
final boolean finalCloseGapBetweenClearAll = closeGapBetweenClearAll;
|
||||
@@ -4540,7 +4544,6 @@ public abstract class RecentsView<
|
||||
}
|
||||
|
||||
public void dismissTask(TaskView taskView, boolean animateTaskView, boolean removeTask) {
|
||||
InteractionJankMonitorWrapper.begin(this, Cuj.CUJ_LAUNCHER_OVERVIEW_TASK_DISMISS);
|
||||
PendingAnimation pa = new PendingAnimation(DISMISS_TASK_DURATION);
|
||||
createTaskDismissAnimation(pa, taskView, animateTaskView, removeTask, DISMISS_TASK_DURATION,
|
||||
false /* dismissingForSplitSelection*/);
|
||||
|
||||
@@ -20,6 +20,7 @@ import static com.android.launcher3.LauncherAnimUtils.VIEW_BACKGROUND_COLOR;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.Animator.AnimatorListener;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.animation.AnimatorSet;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.animation.TimeInterpolator;
|
||||
@@ -121,19 +122,31 @@ public class AnimatedPropertySetter extends PropertySetter {
|
||||
* Adds a listener to be run on every frame of the animation
|
||||
*/
|
||||
public void addOnFrameListener(ValueAnimator.AnimatorUpdateListener listener) {
|
||||
if (mProgressAnimator == null) {
|
||||
mProgressAnimator = ValueAnimator.ofFloat(0, 1);
|
||||
}
|
||||
|
||||
mProgressAnimator.addUpdateListener(listener);
|
||||
getProgressAnimator().addUpdateListener(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addEndListener(Consumer<Boolean> listener) {
|
||||
getProgressAnimator().addListener(AnimatorListeners.forEndCallback(listener));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a callback to run on progress start.
|
||||
*/
|
||||
public void addStartListener(Runnable listener) {
|
||||
getProgressAnimator().addListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationStart(Animator animation) {
|
||||
listener.run();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private ValueAnimator getProgressAnimator() {
|
||||
if (mProgressAnimator == null) {
|
||||
mProgressAnimator = ValueAnimator.ofFloat(0, 1);
|
||||
}
|
||||
mProgressAnimator.addListener(AnimatorListeners.forEndCallback(listener));
|
||||
return mProgressAnimator;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user