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

Delay thumbnail taking after Tab-to-GTS animation

Delay the thumbnail taking a bit more to make it less likely to happen
before the thumbnail taking triggered by ThumbnailFetcher. This is
likely to happen when "skip-slow-zooming" replaces the shrinking
animation with a short fade-in animation.

Bug: 996385
Change-Id: I5fd91e1ac43dba520f41d10c34162502376c9824
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764661
Commit-Queue: Wei-Yin Chen (陳威尹) <wychen@chromium.org>
Reviewed-by: default avatarMei Liang <meiliang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689741}
parent 48c5ee02
...@@ -12,6 +12,7 @@ import android.animation.AnimatorSet; ...@@ -12,6 +12,7 @@ import android.animation.AnimatorSet;
import android.content.Context; import android.content.Context;
import android.graphics.Rect; import android.graphics.Rect;
import android.graphics.RectF; import android.graphics.RectF;
import android.os.Handler;
import android.os.SystemClock; import android.os.SystemClock;
import android.text.TextUtils; import android.text.TextUtils;
...@@ -109,8 +110,12 @@ public class StartSurfaceLayout extends Layout implements StartSurface.OverviewM ...@@ -109,8 +110,12 @@ public class StartSurfaceLayout extends Layout implements StartSurface.OverviewM
// janky frames. // janky frames.
// When animation is off, the thumbnail is already updated when showing the GTS. // When animation is off, the thumbnail is already updated when showing the GTS.
if (FeatureUtilities.isTabToGtsAnimationEnabled()) { if (FeatureUtilities.isTabToGtsAnimationEnabled()) {
Tab currentTab = mTabModelSelector.getCurrentTab(); // Delay thumbnail taking a bit more to make it less likely to happen before the
if (currentTab != null) mTabContentManager.cacheTabThumbnail(currentTab); // thumbnail taking triggered by ThumbnailFetcher. See crbug.com/996385 for details.
new Handler().postDelayed(() -> {
Tab currentTab = mTabModelSelector.getCurrentTab();
if (currentTab != null) mTabContentManager.cacheTabThumbnail(currentTab);
}, ZOOMING_DURATION);
} }
} }
......
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