diff options
author | Kevin <kevhan@google.com> | 2019-04-18 13:46:47 -0700 |
---|---|---|
committer | Kevin Han <kevhan@google.com> | 2019-04-23 19:24:58 +0000 |
commit | 56abdd7ade200a3c5dc8bca5f147ee593a313323 (patch) | |
tree | e4c5ea44fa176d2004612f4cc689ab202c7f9c9e /go/quickstep | |
parent | 1866ecf6382b7536f929f1ce2599e0368c40a7f1 (diff) | |
download | android_packages_apps_Trebuchet-56abdd7ade200a3c5dc8bca5f147ee593a313323.tar.gz android_packages_apps_Trebuchet-56abdd7ade200a3c5dc8bca5f147ee593a313323.tar.bz2 android_packages_apps_Trebuchet-56abdd7ade200a3c5dc8bca5f147ee593a313323.zip |
Only switch item animator on content fill if needed
We currently switch to a different recycler view item animator for a
special content fill animation when we have loading item UI up and want
to animate to the actual content. However, it's possible if the task
content loading is fast enough, we may return before the adapter
changes have actually propogated to the recycler view layout. In this
case there is no loading UI to fill and we should not switch item
animators.
Bug: 130820737
Test: Go from app => overview, try to remove, remove animation occurs
properly
Change-Id: Ic95854d04df98023f444daf967c58bdd8177722a
(cherry picked from commit 035f0d2157b6dcc303138374f032a9016a4bc4f3)
Diffstat (limited to 'go/quickstep')
-rw-r--r-- | go/quickstep/src/com/android/quickstep/views/IconRecentsView.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java b/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java index a0efce456..3c08b7ec7 100644 --- a/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java +++ b/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java @@ -243,9 +243,13 @@ public final class IconRecentsView extends FrameLayout { throw new IllegalStateException("There are less empty item views than the number " + "of items to animate to."); } - // Set item animator for content filling animation. The item animator will switch back - // to the default on completion. - mTaskRecyclerView.setItemAnimator(mLoadingContentItemAnimator); + // 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()) { + // Set item animator for content filling animation. The item animator will switch + // back to the default on completion + mTaskRecyclerView.setItemAnimator(mLoadingContentItemAnimator); + } mTaskAdapter.notifyItemRangeRemoved(numActualItems, numEmptyItems - numActualItems); mTaskAdapter.notifyItemRangeChanged( 0, numActualItems, CHANGE_EVENT_TYPE_EMPTY_TO_CONTENT); |