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

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

Issue 1965363002: Set the parent viewport on the NewTabPageScroll (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/NewTabPageScrollView.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageScrollView.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageScrollView.java
index 2f9715d166313872f53b03de4a434ff57c64dc66..878742234310b88ce9b46c84e763127d9b3b4cc3 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageScrollView.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageScrollView.java
@@ -42,6 +42,8 @@ public class NewTabPageScrollView extends ScrollView {
private GestureDetector mGestureDetector;
private OnScrollListener mOnScrollListener;
+ private NewTabPageLayout mNewTabPageLayout;
+
private FadingShadow mFadingShadow;
/**
@@ -75,6 +77,22 @@ public class NewTabPageScrollView extends ScrollView {
}
@Override
+ protected void onFinishInflate() {
+ super.onFinishInflate();
+
+ // Incognito also uses this scroll view but will not have the id so will return null.
+ mNewTabPageLayout = (NewTabPageLayout) findViewById(R.id.ntp_content);
+ }
+
+ @Override
+ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ if (mNewTabPageLayout != null) {
+ mNewTabPageLayout.setParentScrollViewportHeight(MeasureSpec.getSize(heightMeasureSpec));
+ }
+ super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+ }
+
+ @Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
mGestureDetector.onTouchEvent(ev);
return super.onInterceptTouchEvent(ev);
« 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