From 3334730a619256af1c27e93b572fd3942b665808 Mon Sep 17 00:00:00 2001 From: Ikram Gabiyev Date: Mon, 20 Mar 2023 17:33:48 +0000 Subject: [PATCH] Create an animation for instance filtering Create an animation for multi instance filtering demo in recents view. Bug: 253520408 Bug: 276488398 Test: manually reproduce the steps in the bug Change-Id: I9f5b4a29f18101b8e33d4e43514dcd8a6c49a7a9 --- .../android/quickstep/views/RecentsView.java | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 9a25e9ca64..7989bb0b65 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -185,6 +185,7 @@ import com.android.quickstep.util.AnimUtils; import com.android.quickstep.util.DesktopTask; import com.android.quickstep.util.GroupTask; import com.android.quickstep.util.LayoutUtils; +import com.android.quickstep.util.RecentsAtomicAnimationFactory; import com.android.quickstep.util.RecentsOrientedState; import com.android.quickstep.util.SplitAnimationController.Companion.SplitAnimInitProps; import com.android.quickstep.util.SplitAnimationTimings; @@ -801,8 +802,29 @@ public abstract class RecentsView { + Animator animatorFade = mActivity.getStateManager().createStateElementAnimation( + RecentsAtomicAnimationFactory.INDEX_RECENTS_FADE_ANIM, 1f, 0f); + Animator animatorAppear = mActivity.getStateManager().createStateElementAnimation( + RecentsAtomicAnimationFactory.INDEX_RECENTS_FADE_ANIM, 0f, 1f); + animatorFade.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(@NonNull Animator animation) { + RecentsView.this.invalidateTaskList(); + updateClearAllFunction(); + reloadIfNeeded(); + if (mPendingAnimation != null) { + mPendingAnimation.addEndListener(success -> { + animatorAppear.start(); + }); + } else { + animatorAppear.start(); + } + } + }); + animatorFade.start(); + }); } // make sure filter is turned off by default mFilterState.setFilterBy(null); @@ -821,8 +843,6 @@ public abstract class RecentsView