Index: chrome/android/java/src/org/chromium/chrome/browser/snackbar/BottomContainer.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/snackbar/BottomContainer.java b/chrome/android/java/src/org/chromium/chrome/browser/snackbar/BottomContainer.java |
index edc4b7e409f27c85537ce8679a7da97b0a2b1a21..aa70df0ea6fb7562e1791367135745ccd014a347 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/snackbar/BottomContainer.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/snackbar/BottomContainer.java |
@@ -6,6 +6,8 @@ package org.chromium.chrome.browser.snackbar; |
import android.content.Context; |
import android.util.AttributeSet; |
+import android.view.View; |
+import android.view.View.MeasureSpec; |
import android.widget.FrameLayout; |
import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager; |
@@ -35,6 +37,23 @@ public class BottomContainer extends FrameLayout implements FullscreenListener { |
setTranslationY(-fullscreenManager.getBottomControlsHeight()); |
} |
+ @Override |
+ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { |
+ int height = 0; |
Ted C
2017/07/18 16:41:18
Why do we need this? Is this view set as MATCH_PA
|
+ int width = MeasureSpec.getSize(widthMeasureSpec); |
+ int count = getChildCount(); |
+ for (int i = 0; i < count; i++) { |
+ final View child = getChildAt(i); |
+ if (child.getVisibility() == GONE) continue; |
+ measureChild(child, widthMeasureSpec, heightMeasureSpec); |
+ width = Math.max(width, child.getMeasuredWidth()); |
+ height = Math.max(height, child.getMeasuredHeight()); |
+ } |
+ height = Math.max(height, getSuggestedMinimumHeight()); |
+ width = Math.max(width, getSuggestedMinimumWidth()); |
+ setMeasuredDimension(width, height); |
+ } |
+ |
// FullscreenListner methods |
@Override |
public void onControlsOffsetChanged(float topOffset, float bottomOffset, boolean needsAnimate) { |