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

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

Issue 1958263003: Add the tabstrip height to the page calculation for peeking card so the card peeks for tablet (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
« 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/NewTabPageLayout.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java
index fd2d366089e616364af1a0b5d183c583b902cc0b..b54dee74d8921d6f19d98452de98563b29956655 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageLayout.java
@@ -100,11 +100,16 @@ public class NewTabPageLayout extends LinearLayout {
// load and has enough space for the peeking card, push snippets to the bottom of the page
// to show the peeking card.
if (mCardsUiEnabled) {
- int peekingCardHeight = getContext().getResources().getDimensionPixelSize(
+ int peekingCardHeight = getResources().getDimensionPixelSize(
R.dimen.snippets_padding_and_peeking_card_height);
- if (mParentScrollViewportHeight >= getMeasuredHeight() + peekingCardHeight) {
+
+ // Height of the tabs for tablet. This will be zero for mobile.
+ int tabStripHeight = getResources().getDimensionPixelSize(R.dimen.tab_strip_height);
+
+ if (mParentScrollViewportHeight
+ >= getMeasuredHeight() + peekingCardHeight + tabStripHeight) {
RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) getLayoutParams();
- params.height = mParentScrollViewportHeight - peekingCardHeight;
+ params.height = mParentScrollViewportHeight - peekingCardHeight - tabStripHeight;
}
}
// TODO(https://crbug.com/609487): Push snippets below the fold when most likely
« 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