Commit f301af7c authored by mvanouwerkerk's avatar mvanouwerkerk Committed by Commit bot

Only allow extra space if scroll below the fold experiment is enabled.

BUG=677908

Review-Url: https://codereview.chromium.org/2609403006
Cr-Commit-Position: refs/heads/master@{#441915}
parent e827c1a7
...@@ -236,7 +236,14 @@ public class NewTabPageRecyclerView extends RecyclerView implements TouchDisable ...@@ -236,7 +236,14 @@ public class NewTabPageRecyclerView extends RecyclerView implements TouchDisable
return 0; return 0;
} }
if (firstVisiblePos > aboveTheFoldPosition && mHasRenderedAboveTheFoldView) { // For the scroll below the fold experiment, the above the fold item must be scrolled away
// completely, so the spacer must be large enough even when we're not sure exactly how
// large it should be. Returning 0 would lead to http://crbug.com/674432.
boolean allowSpaceForInitiallyScrollingBelowTheFold =
CardsVariationParameters.isScrollBelowTheFoldEnabled()
&& !mHasRenderedAboveTheFoldView;
if (firstVisiblePos > aboveTheFoldPosition
&& !allowSpaceForInitiallyScrollingBelowTheFold) {
// We have enough items to fill the viewport, since we have scrolled past the // We have enough items to fill the viewport, since we have scrolled past the
// above-the-fold item. We must check whether the above-the-fold view has been rendered // above-the-fold item. We must check whether the above-the-fold view has been rendered
// at least once, because it's possible to skip right over it if the initial scroll // at least once, because it's possible to skip right over it if the initial scroll
......
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