diff options
Diffstat (limited to 'go')
-rw-r--r-- | go/quickstep/src/com/android/quickstep/FallbackActivityControllerHelper.java | 2 | ||||
-rw-r--r-- | go/quickstep/src/com/android/quickstep/views/IconRecentsView.java | 35 |
2 files changed, 29 insertions, 8 deletions
diff --git a/go/quickstep/src/com/android/quickstep/FallbackActivityControllerHelper.java b/go/quickstep/src/com/android/quickstep/FallbackActivityControllerHelper.java index d39a66c70..eb0c5b942 100644 --- a/go/quickstep/src/com/android/quickstep/FallbackActivityControllerHelper.java +++ b/go/quickstep/src/com/android/quickstep/FallbackActivityControllerHelper.java @@ -45,12 +45,12 @@ public final class FallbackActivityControllerHelper extends @Override public AnimationFactory prepareRecentsUI(RecentsActivity activity, boolean activityVisible, boolean animateActivity, Consumer<AnimatorPlaybackController> callback) { - // TODO: Logic for setting remote animation if (activityVisible) { return (transitionLength) -> { }; } IconRecentsView rv = activity.getOverviewPanel(); + rv.setUsingRemoteAnimation(true); rv.setAlpha(0); return new AnimationFactory() { diff --git a/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java b/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java index 82760785b..771c7d7fa 100644 --- a/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java +++ b/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java @@ -153,6 +153,8 @@ public final class IconRecentsView extends FrameLayout implements Insettable { private View mContentView; private boolean mTransitionedFromApp; private boolean mUsingRemoteAnimation; + private boolean mStartedEnterAnimation; + private boolean mShowStatusBarForegroundScrim; private AnimatorSet mLayoutAnimation; private final ArraySet<View> mLayingOutViews = new ArraySet<>(); private Rect mInsets; @@ -298,6 +300,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 +325,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); }); } @@ -401,7 +410,14 @@ public final class IconRecentsView extends FrameLayout implements Insettable { * @param showStatusBarForegroundScrim true to show the scrim, false to hide */ public void setShowStatusBarForegroundScrim(boolean showStatusBarForegroundScrim) { - boolean shouldShow = mInsets.top != 0 && showStatusBarForegroundScrim; + mShowStatusBarForegroundScrim = showStatusBarForegroundScrim; + if (mShowStatusBarForegroundScrim != showStatusBarForegroundScrim) { + updateStatusBarScrim(); + } + } + + private void updateStatusBarScrim() { + boolean shouldShow = mInsets.top != 0 && mShowStatusBarForegroundScrim; mActivity.getDragLayer().setForeground(shouldShow ? mStatusBarForegroundScrim : null); } @@ -622,6 +638,7 @@ public final class IconRecentsView extends FrameLayout implements Insettable { } }); mLayoutAnimation.start(); + mStartedEnterAnimation = true; } /** @@ -647,6 +664,7 @@ public final class IconRecentsView extends FrameLayout implements Insettable { playRemoteAppScaleDownAnim(anim, appMatrix, appTarget, recentsTarget, bottomView.getThumbnailView()); playRemoteTaskListFadeIn(anim, bottomView); + mStartedEnterAnimation = true; } /** @@ -828,6 +846,9 @@ public final class IconRecentsView extends FrameLayout implements Insettable { mInsets = insets; mTaskRecyclerView.setPadding(insets.left, insets.top, insets.right, insets.bottom); mTaskRecyclerView.invalidateItemDecorations(); + if (mInsets.top != 0) { + updateStatusBarScrim(); + } } /** |