Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1882)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerView.java

Issue 2609403006: Only allow extra space if scroll below the fold experiment is enabled. (Closed)
Patch Set: Add comment. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerView.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerView.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerView.java
index 525d1012f8e008cec76371f8536bbc01e3d5e9fa..f3461d3ab64e8a3c7114cd068db7963095901671 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerView.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerView.java
@@ -236,7 +236,14 @@ public class NewTabPageRecyclerView extends RecyclerView implements TouchDisable
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
// 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698