summaryrefslogtreecommitdiffstats
path: root/go
diff options
context:
space:
mode:
authorKevin <kevhan@google.com>2019-05-10 09:36:56 -0700
committerKevin <kevhan@google.com>2019-05-10 10:18:05 -0700
commit47fc4f13169a6e659a78ec234ff11df9a218d84f (patch)
tree7873a20bee278a94af0c9f57fb76a925801b2305 /go
parent0f07b87420c37cc7c2b2d666a3d4e11f637aafc0 (diff)
downloadandroid_packages_apps_Trebuchet-47fc4f13169a6e659a78ec234ff11df9a218d84f.tar.gz
android_packages_apps_Trebuchet-47fc4f13169a6e659a78ec234ff11df9a218d84f.tar.bz2
android_packages_apps_Trebuchet-47fc4f13169a6e659a78ec234ff11df9a218d84f.zip
Only do content fill anim after layout anim
The new remote animation may start after the tasks are loaded and we start the content fill animation. This means the layout happens after and the content fill animation will conflict with the layout animation. To fix this, we should only do the content fill animation after the layout animation as intended. If the tasks load before we start the layout animation, we should just directly update to the latest UI without animating as the views won't be visible before the layout animation starts. Bug: 132381412 Test: Manual test Change-Id: Ibb55d8ef4499260ffa4bef5c6bba605ffdc85da7
Diffstat (limited to 'go')
-rw-r--r--go/quickstep/src/com/android/quickstep/views/IconRecentsView.java22
1 files changed, 16 insertions, 6 deletions
diff --git a/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java b/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java
index 82760785b..a53a06e86 100644
--- a/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java
+++ b/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java
@@ -153,6 +153,7 @@ public final class IconRecentsView extends FrameLayout implements Insettable {
private View mContentView;
private boolean mTransitionedFromApp;
private boolean mUsingRemoteAnimation;
+ private boolean mStartedEnterAnimation;
private AnimatorSet mLayoutAnimation;
private final ArraySet<View> mLayingOutViews = new ArraySet<>();
private Rect mInsets;
@@ -298,6 +299,7 @@ public final class IconRecentsView extends FrameLayout implements Insettable {
* becomes visible.
*/
public void onBeginTransitionToOverview() {
+ mStartedEnterAnimation = false;
if (mContext.getResources().getConfiguration().orientation == ORIENTATION_LANDSCAPE) {
// Scroll to bottom of task in landscape mode. This is a non-issue in portrait mode as
// all tasks should be visible to fill up the screen in portrait mode and the view will
@@ -322,16 +324,22 @@ public final class IconRecentsView extends FrameLayout implements Insettable {
+ "of items to animate to.");
}
// Possible that task list loads faster than adapter changes propagate to layout so
- // only start content fill animation if there aren't any pending adapter changes.
- if (!mTaskRecyclerView.hasPendingAdapterUpdates()) {
+ // only start content fill animation if there aren't any pending adapter changes and
+ // we've started the on enter layout animation.
+ boolean needsContentFillAnimation =
+ !mTaskRecyclerView.hasPendingAdapterUpdates() && mStartedEnterAnimation;
+ if (needsContentFillAnimation) {
// Set item animator for content filling animation. The item animator will switch
// back to the default on completion
mTaskRecyclerView.setItemAnimator(mLoadingContentItemAnimator);
+ mTaskAdapter.notifyItemRangeRemoved(TASKS_START_POSITION + numActualItems,
+ numEmptyItems - numActualItems);
+ mTaskAdapter.notifyItemRangeChanged(TASKS_START_POSITION, numActualItems,
+ CHANGE_EVENT_TYPE_EMPTY_TO_CONTENT);
+ } else {
+ // Notify change without animating.
+ mTaskAdapter.notifyDataSetChanged();
}
- mTaskAdapter.notifyItemRangeRemoved(TASKS_START_POSITION + numActualItems,
- numEmptyItems - numActualItems);
- mTaskAdapter.notifyItemRangeChanged(TASKS_START_POSITION, numActualItems,
- CHANGE_EVENT_TYPE_EMPTY_TO_CONTENT);
});
}
@@ -622,6 +630,7 @@ public final class IconRecentsView extends FrameLayout implements Insettable {
}
});
mLayoutAnimation.start();
+ mStartedEnterAnimation = true;
}
/**
@@ -647,6 +656,7 @@ public final class IconRecentsView extends FrameLayout implements Insettable {
playRemoteAppScaleDownAnim(anim, appMatrix, appTarget, recentsTarget,
bottomView.getThumbnailView());
playRemoteTaskListFadeIn(anim, bottomView);
+ mStartedEnterAnimation = true;
}
/**