Commit 14670292 authored by Wei-Yin Chen (陳威尹)'s avatar Wei-Yin Chen (陳威尹) Committed by Commit Bot

Disable scrolling animation in Tab-to-Grid transition animation

After Grid Tab Switcher (GTS) can be lazily cleared
(added in http://crrev.com/c/1636621), when showing Tab-to-Grid
transition animation while GTS is not cleared yet, a scrolling
animation can be seen.

This CL fixes that by disabling scroll animation when playing
transition animation.

Bug: 968822
Change-Id: Id067065808dfc40bd608b3b0c6b80ed735e547aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1641809Reviewed-by: default avatarYusuf Ozuysal <yusufo@chromium.org>
Commit-Queue: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#665808}
parent 763f11d8
...@@ -68,7 +68,7 @@ class TabListRecyclerView extends RecyclerView { ...@@ -68,7 +68,7 @@ class TabListRecyclerView extends RecyclerView {
private VisibilityListener mListener; private VisibilityListener mListener;
private ViewResourceAdapter mDynamicView; private ViewResourceAdapter mDynamicView;
private long mLastDirtyTime; private long mLastDirtyTime;
private long mOriginalAddDuration; private RecyclerView.ItemAnimator mOriginalAnimator;
/** /**
* Basic constructor to use during inflation from xml. * Basic constructor to use during inflation from xml.
...@@ -88,9 +88,9 @@ class TabListRecyclerView extends RecyclerView { ...@@ -88,9 +88,9 @@ class TabListRecyclerView extends RecyclerView {
void prepareOverview() { void prepareOverview() {
endAllAnimations(); endAllAnimations();
// Make all the items show up immediately. // Stop all the animations to make all the items show up and scroll to position immediately.
mOriginalAddDuration = getItemAnimator().getAddDuration(); mOriginalAnimator = getItemAnimator();
getItemAnimator().setAddDuration(0); setItemAnimator(null);
} }
/** /**
...@@ -113,7 +113,7 @@ class TabListRecyclerView extends RecyclerView { ...@@ -113,7 +113,7 @@ class TabListRecyclerView extends RecyclerView {
mFadeInAnimator = null; mFadeInAnimator = null;
mListener.finishedShowing(); mListener.finishedShowing();
// Restore the original value. // Restore the original value.
getItemAnimator().setAddDuration(mOriginalAddDuration); setItemAnimator(mOriginalAnimator);
if (mDynamicView != null) if (mDynamicView != null)
mDynamicView.dropCachedBitmap(); mDynamicView.dropCachedBitmap();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment