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

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

Issue 2127083002: Ntp, darken the color of the overScroll for the RecyclerView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changes Created 4 years, 5 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
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 9725c89cdddc641bfa5881ef312d279ec95e5125..f833e7abf9fe670fc2182cc6efd698da8ff369b4 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
@@ -27,11 +27,6 @@ public class NewTabPageRecyclerView extends RecyclerView {
private static final String TAG = "NtpCards";
/**
- * Minimum height of the bottom spacing item.
- */
- private static final int MIN_BOTTOM_SPACING = 0;
-
- /**
* Positions of key items in the RecyclerView.
*/
private static final int ABOVE_THE_FOLD_ITEM_POSITION = 0;
@@ -41,6 +36,7 @@ public class NewTabPageRecyclerView extends RecyclerView {
private final GestureDetector mGestureDetector;
private final LinearLayoutManager mLayoutManager;
private final int mToolbarHeight;
+ private final int mMinBottomSpacing;
/**
* Total height of the items being dismissed. Tracked to allow the bottom space to compensate
@@ -72,6 +68,8 @@ public class NewTabPageRecyclerView extends RecyclerView {
Resources res = context.getResources();
mToolbarHeight = res.getDimensionPixelSize(R.dimen.toolbar_height_no_shadow)
+ res.getDimensionPixelSize(R.dimen.toolbar_progress_bar_height);
+ mMinBottomSpacing =
+ res.getDimensionPixelSize(R.dimen.ntp_min_bottom_spacing_recycler_view);
}
public boolean isFirstItemVisible() {
@@ -160,7 +158,7 @@ public class NewTabPageRecyclerView extends RecyclerView {
int firstVisiblePos = mLayoutManager.findFirstVisibleItemPosition();
// We have enough items to fill the view, since the snap point item is not even visible.
- if (firstVisiblePos > ARTICLES_HEADER_ITEM_POSITION) return MIN_BOTTOM_SPACING;
+ if (firstVisiblePos > ARTICLES_HEADER_ITEM_POSITION) return mMinBottomSpacing;
// The spacing item is the last item, the last content item is directly above that.
int lastContentItemPosition = getAdapter().getItemCount() - 2;
@@ -190,7 +188,7 @@ public class NewTabPageRecyclerView extends RecyclerView {
bottomSpacing -= contentHeight - mCompensationHeight;
}
- return Math.max(MIN_BOTTOM_SPACING, bottomSpacing);
+ return Math.max(mMinBottomSpacing, bottomSpacing);
}
/**
« chrome/android/java/res/values-v17/styles.xml ('K') | « chrome/android/java/res/values/dimens.xml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698