Commit 91d96fbd authored by twellington's avatar twellington Committed by Commit bot

[Home] Reduce bottom control container height

BUG=716149

Review-Url: https://codereview.chromium.org/2844373003
Cr-Commit-Position: refs/heads/master@{#468026}
parent fb645f07
......@@ -201,8 +201,9 @@
<!-- Full Screen Dimensions -->
<!-- Should match toolbar_height_no_shadow -->
<dimen name="control_container_height">56dp</dimen>
<dimen name="bottom_control_container_height">64dp</dimen>
<dimen name="bottom_toolbar_top_margin">8dp</dimen>
<dimen name="bottom_control_container_height">56dp</dimen>
<dimen name="bottom_toolbar_top_margin">2dp</dimen>
<dimen name="bottom_toolbar_url_bar_top_margin">4dp</dimen>
<dimen name="custom_tabs_control_container_height">56dp</dimen>
<dimen name="webapp_control_container_height">22dp</dimen>
......@@ -245,10 +246,10 @@
<dimen name="toolbar_shadow_height">8dp</dimen>
<dimen name="toolbar_progress_bar_height">2dp</dimen>
<dimen name="toolbar_button_width">48dp</dimen>
<dimen name="toolbar_handle_height">4dp</dimen>
<dimen name="toolbar_handle_width">40dp</dimen>
<dimen name="toolbar_handle_corner_radius">2dp</dimen>
<dimen name="toolbar_handle_margin_top">14dp</dimen>
<dimen name="toolbar_handle_height">3dp</dimen>
<dimen name="toolbar_handle_width">24dp</dimen>
<dimen name="toolbar_handle_corner_radius">1.5dp</dimen>
<dimen name="toolbar_handle_margin_top">12dp</dimen>
<dimen name="toolbar_edge_padding">8dp</dimen>
<dimen name="location_bar_google_g_width">24dp</dimen>
......@@ -256,6 +257,7 @@
<!-- location_bar_google_g_width + 2 * location_bar_google_g_margin -->
<dimen name="location_bar_google_g_container_width">40dp</dimen>
<dimen name="location_bar_vertical_margin">8dp</dimen>
<dimen name="bottom_location_bar_vertical_margin">9dp</dimen>
<dimen name="location_bar_url_text_size">16sp</dimen>
<dimen name="location_bar_incognito_badge_padding">7dp</dimen>
<dimen name="location_bar_icon_width">32dp</dimen>
......
......@@ -278,7 +278,7 @@ public class AppMenu implements OnItemClickListener, OnKeyListener {
private boolean isAnchorAtBottom(View anchorView, Rect visibleDisplayFrame) {
anchorView.getLocationOnScreen(mTempLocation);
return (mTempLocation[1] + anchorView.getHeight()) == visibleDisplayFrame.bottom;
return (mTempLocation[1] + anchorView.getHeight()) >= visibleDisplayFrame.bottom;
}
private void setPopupOffset(
......
......@@ -117,6 +117,8 @@ public class BottomToolbarPhone extends ToolbarPhone {
context.getResources(), R.drawable.toolbar_handle_dark);
mHandleLight = ApiCompatibilityUtils.getDrawable(
context.getResources(), R.drawable.toolbar_handle_light);
mLocationBarVerticalMargin =
getResources().getDimensionPixelOffset(R.dimen.bottom_location_bar_vertical_margin);
}
/**
......@@ -208,6 +210,11 @@ public class BottomToolbarPhone extends ToolbarPhone {
public void onFinishInflate() {
super.onFinishInflate();
// Add extra top margin to the URL bar to compensate for the change to location bar's
// vertical margin in the constructor.
((MarginLayoutParams) mLocationBar.findViewById(R.id.url_bar).getLayoutParams()).topMargin =
getResources().getDimensionPixelSize(R.dimen.bottom_toolbar_url_bar_top_margin);
// Exclude the location bar from the list of browsing mode views. This prevents its
// visibility from changing during transitions.
mBrowsingModeViews.remove(mLocationBar);
......
......@@ -225,8 +225,8 @@ public class ToolbarPhone extends ToolbarLayout
private final Point mNtpSearchBoxTranslation = new Point();
private final int mToolbarSidePadding;
private final int mLocationBarVerticalMargin;
private final int mLocationBarBackgroundCornerRadius;
protected int mLocationBarVerticalMargin;
private ValueAnimator mBrandColorTransitionAnimation;
private boolean mBrandColorTransitionActive;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment