summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin <kevhan@google.com>2019-04-25 12:53:20 -0700
committerKevin <kevhan@google.com>2019-04-25 12:53:20 -0700
commit1335c36c15bbd92ee43b0f4a228b604422711b05 (patch)
treed5dbd43483bfc54e75219ec412cb6f33c96af2bd
parent587421adbfb51e08f1a68a177dc335c1554fd6ec (diff)
downloadandroid_packages_apps_Trebuchet-1335c36c15bbd92ee43b0f4a228b604422711b05.tar.gz
android_packages_apps_Trebuchet-1335c36c15bbd92ee43b0f4a228b604422711b05.tar.bz2
android_packages_apps_Trebuchet-1335c36c15bbd92ee43b0f4a228b604422711b05.zip
Don't layout empty tasks in layout anim if we have the actual content.
When we load the task content (icons, snapshots, etc), oftentimes, we are still in the middle of the layout animation where items are fading in from bottom to top. At this point, we start a second content-fill animation from bottom to top that fades from empty => filled after the first animation. However, we can improve this so that empty views aren't shown for a split second for some of the later laid out views. If the first animation has not finished and we would animate a content change from empty => filled but the view is currently still not visible, we should just complete the content transition on the spot so that the layout animation lays out the filled version instead. Bug: 131339235 Test: Go to recents, observe lay out animation does not continue to lay out the empty view first Change-Id: I936a81e6cf8b3552cdee90c183fc841f50ec9ea8
-rw-r--r--go/quickstep/src/com/android/quickstep/ContentFillItemAnimator.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/go/quickstep/src/com/android/quickstep/ContentFillItemAnimator.java b/go/quickstep/src/com/android/quickstep/ContentFillItemAnimator.java
index 1b6f2e34d..928234553 100644
--- a/go/quickstep/src/com/android/quickstep/ContentFillItemAnimator.java
+++ b/go/quickstep/src/com/android/quickstep/ContentFillItemAnimator.java
@@ -161,6 +161,13 @@ public final class ContentFillItemAnimator extends SimpleItemAnimator {
private void animateChangeImpl(ViewHolder viewHolder, long startDelay) {
TaskItemView itemView = (TaskItemView) viewHolder.itemView;
+ if (itemView.getAlpha() == 0) {
+ // View is still not visible, so we can finish the change immediately.
+ CONTENT_TRANSITION_PROGRESS.set(itemView, 1.0f);
+ dispatchChangeFinished(viewHolder, true /* oldItem */);
+ dispatchFinishedWhenDone();
+ return;
+ }
final ObjectAnimator anim =
ObjectAnimator.ofFloat(itemView, CONTENT_TRANSITION_PROGRESS, 0.0f, 1.0f);
anim.setDuration(ITEM_CHANGE_DURATION).setStartDelay(startDelay);