Commit a272f890 authored by Ryan Landay's avatar Ryan Landay Committed by Commit Bot

Fix blank tabs during scrolling in Android horizontal tab switcher

In the Android horizontal tab switcher, we determine which tab thumbnails to
render based on the index of the currently-centered tab, as determined by
NonOverlappingStack#computeReferenceIndex() (this is a virtual method called by
Stack since the logic for updating visibility is shared between the overlapping
and non-overlapping tab switchers). We currently have a bug where the tab
thumbnails are becoming blank during quick scrolling. This is because the
current implementation of this method uses mScrollTarget instead of
mScrollOffset to determine the centered tab (basically, mScrollTarget is where
we're going and mScrollOffset is where we are, and is actually used for
rendering).

This CL fixes this bug by updating this method's implementation to use the value
returned from getCenteredTabIndex(), which uses mScrollOffset instead of
mScrollTarget.

Bug: 853879,831359
Change-Id: I129c03ca80297c15b670d223bfc6630b6d8de68c
Reviewed-on: https://chromium-review.googlesource.com/1105021Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Commit-Queue: Ryan Landay <rlanday@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568203}
parent 19dcc411
......@@ -247,7 +247,7 @@ public class NonOverlappingStack extends Stack {
@Override
protected int computeReferenceIndex() {
return -Math.round(mScrollTarget / mSpacing);
return getCenteredTabIndex();
}
@Override
......
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