Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarPhone.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarPhone.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarPhone.java |
| index 494538dd9c63e7a07c7dd209b05ab81c8ea0ff1c..18dbc648d6069d31c0e9f31910e1bd63e835704b 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarPhone.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarPhone.java |
| @@ -5,6 +5,7 @@ |
| package org.chromium.chrome.browser.toolbar; |
| import android.content.Context; |
| +import android.support.v7.widget.Toolbar; |
| import android.util.AttributeSet; |
| import android.view.ViewGroup; |
| @@ -31,6 +32,25 @@ public class BottomToolbarPhone extends ToolbarPhone implements BottomSheetObser |
| private float mLastHeightFraction; |
| /** |
| + * Sets the height and title text appearance of the provided toolbar so that its style is |
| + * consistent with BottomToolbarPhone. |
| + * @param toolbar The toolbar to style. |
| + */ |
| + public static void setToolbarStyle(Toolbar toolbar) { |
| + // Android's Toolbar class typically changes its height based on device orientation. |
| + // BottomToolbarPhone has a fixed height. Update |toolbar| to match. |
| + toolbar.getLayoutParams().height = |
| + toolbar.getResources().getDimensionPixelOffset(R.dimen.toolbar_height_no_shadow); |
|
Theresa
2017/03/14 16:29:43
This will also change to bottom_control_container_
mdjones
2017/03/14 20:08:36
I'm going to try to land a patch that adds getHeig
|
| + |
| + // Android Toolbar action buttons are aligned based on the minimum height. |
| + toolbar.setMinimumHeight( |
| + toolbar.getResources().getDimensionPixelOffset(R.dimen.toolbar_height_no_shadow)); |
|
Theresa
2017/03/14 16:29:43
The toolbar will get bottom_toolbar_top_margin as
|
| + |
| + toolbar.setTitleTextAppearance(toolbar.getContext(), R.style.BottomSheetContentTitle); |
| + toolbar.requestLayout(); |
| + } |
| + |
| + /** |
| * Constructs a BottomToolbarPhone object. |
| * @param context The Context in which this View object is created. |
| * @param attrs The AttributeSet that was specified with this View. |