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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetItemDecoration.java

Issue 1947263003: Pin the snippets to the bottom of the page and introduce a peeking card to indicate to the user the… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/snippets/SnippetItemDecoration.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetItemDecoration.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetItemDecoration.java
index b80bb70649e738b23fcda715af141aa235615927..e7590a127ebfbda10365ba73f848266fadee88a6 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetItemDecoration.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetItemDecoration.java
@@ -17,7 +17,10 @@ public class SnippetItemDecoration extends RecyclerView.ItemDecoration {
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent,
RecyclerView.State state) {
+ // Reset the bounds of the outRect.
outRect.setEmpty();
+
+ // Do not add a vertical space to the last item.
if (parent.getChildAdapterPosition(view) != parent.getAdapter().getItemCount() - 1) {
outRect.bottom = VERTICAL_SPACE;
}

Powered by Google App Engine
This is Rietveld 408576698