Commit c0746bf1 authored by Theresa's avatar Theresa Committed by Commit Bot

Revert "Define toolbar button height and width in-line instead of in styles.xml"

This reverts commit 358ed727.

Reason for revert:  Speculative fix didn't fix crashes. See bug for details.

Original change's description:
> Define toolbar button height and width in-line instead of in styles.xml
> 
> Define the layout_height and layout_width for ToolbarButton elements
> in-line rather than in styles.xml. This is a speculative fix for crash
> reports we've received indicating these attributes are missing.
> 
> BUG=779271
> 
> Change-Id: I732ee9b39262aa8bfbc74dea57ea72469cd9e647
> Reviewed-on: https://chromium-review.googlesource.com/764378
> Commit-Queue: Theresa <twellington@chromium.org>
> Reviewed-by: Ted Choc <tedchoc@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#515966}

TBR=tedchoc@chromium.org,twellington@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 779271
Change-Id: I60d3e400fc77f51c098ebb282e6d037f8242fb9c
Reviewed-on: https://chromium-review.googlesource.com/794011Reviewed-by: default avatarTheresa <twellington@chromium.org>
Commit-Queue: Theresa <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519706}
parent ad8eb1eb
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
found in the LICENSE file. --> found in the LICENSE file. -->
<ImageButton xmlns:android="http://schemas.android.com/apk/res/android" <ImageButton xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/ToolbarButton" style="@style/ToolbarButton"
android:layout_height="@dimen/toolbar_height_no_shadow"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="1" android:layout_weight="1"
android:contentDescription="@null" android:contentDescription="@null"
......
...@@ -12,8 +12,6 @@ ...@@ -12,8 +12,6 @@
<ImageButton <ImageButton
android:id="@+id/close_button" android:id="@+id/close_button"
style="@style/ToolbarButton" style="@style/ToolbarButton"
android:layout_height="@dimen/toolbar_height_no_shadow"
android:layout_width="@dimen/toolbar_button_width"
android:layout_gravity="start|center_vertical" android:layout_gravity="start|center_vertical"
android:contentDescription="@string/close_tab" /> android:contentDescription="@string/close_tab" />
<FrameLayout <FrameLayout
...@@ -65,7 +63,6 @@ ...@@ -65,7 +63,6 @@
<ImageButton <ImageButton
android:id="@+id/action_button" android:id="@+id/action_button"
style="@style/ToolbarButton" style="@style/ToolbarButton"
android:layout_height="@dimen/toolbar_height_no_shadow"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:maxWidth="@dimen/custom_tabs_toolbar_maxWidth" android:maxWidth="@dimen/custom_tabs_toolbar_maxWidth"
android:paddingTop="@dimen/custom_tabs_toolbar_vertical_padding" android:paddingTop="@dimen/custom_tabs_toolbar_vertical_padding"
...@@ -80,8 +77,7 @@ ...@@ -80,8 +77,7 @@
android:id="@+id/menu_button" android:id="@+id/menu_button"
style="@style/ToolbarButton" style="@style/ToolbarButton"
android:layout_gravity="center_vertical|end" android:layout_gravity="center_vertical|end"
android:layout_height="@dimen/toolbar_height_no_shadow" android:layout_width="42dp"
android:layout_width="@dimen/toolbar_menu_button_width"
android:paddingEnd="4dp" android:paddingEnd="4dp"
android:src="@drawable/ic_more_vert_black_24dp" android:src="@drawable/ic_more_vert_black_24dp"
android:contentDescription="@string/accessibility_toolbar_btn_menu" android:contentDescription="@string/accessibility_toolbar_btn_menu"
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
<view class="org.chromium.chrome.browser.widget.newtab.NewTabButton" <view class="org.chromium.chrome.browser.widget.newtab.NewTabButton"
android:id="@+id/empty_new_tab_button" android:id="@+id/empty_new_tab_button"
style="@style/ToolbarButton" style="@style/ToolbarButton"
android:layout_height="@dimen/toolbar_height_no_shadow"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_gravity="start|top" android:layout_gravity="start|top"
android:paddingStart="16dp" android:paddingStart="16dp"
......
...@@ -44,21 +44,18 @@ ...@@ -44,21 +44,18 @@
android:id="@+id/find_prev_button" android:id="@+id/find_prev_button"
style="@style/ToolbarButton" style="@style/ToolbarButton"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_width="@dimen/toolbar_button_width"
android:src="@drawable/ic_collapsed" android:src="@drawable/ic_collapsed"
android:contentDescription="@string/accessibility_find_toolbar_btn_prev" /> android:contentDescription="@string/accessibility_find_toolbar_btn_prev" />
<org.chromium.chrome.browser.widget.TintedImageButton <org.chromium.chrome.browser.widget.TintedImageButton
android:id="@+id/find_next_button" android:id="@+id/find_next_button"
style="@style/ToolbarButton" style="@style/ToolbarButton"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_width="@dimen/toolbar_button_width"
android:src="@drawable/ic_expanded" android:src="@drawable/ic_expanded"
android:contentDescription="@string/accessibility_find_toolbar_btn_next" /> android:contentDescription="@string/accessibility_find_toolbar_btn_next" />
<org.chromium.chrome.browser.widget.TintedImageButton <org.chromium.chrome.browser.widget.TintedImageButton
android:id="@+id/close_find_button" android:id="@+id/close_find_button"
style="@style/ToolbarButton" style="@style/ToolbarButton"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_width="@dimen/toolbar_button_width"
android:src="@drawable/btn_close" android:src="@drawable/btn_close"
android:contentDescription="@string/close" /> android:contentDescription="@string/close" />
</LinearLayout> </LinearLayout>
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
<org.chromium.chrome.browser.widget.newtab.NewTabButton <org.chromium.chrome.browser.widget.newtab.NewTabButton
android:id="@+id/new_tab_button" android:id="@+id/new_tab_button"
style="@style/ToolbarButton" style="@style/ToolbarButton"
android:layout_height="@dimen/toolbar_height_no_shadow"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_gravity="start|top" android:layout_gravity="start|top"
android:paddingStart="16dp" android:paddingStart="16dp"
...@@ -23,8 +22,6 @@ ...@@ -23,8 +22,6 @@
<org.chromium.chrome.browser.toolbar.HomePageButton <org.chromium.chrome.browser.toolbar.HomePageButton
android:id="@+id/home_button" android:id="@+id/home_button"
style="@style/ToolbarButton" style="@style/ToolbarButton"
android:layout_height="@dimen/toolbar_height_no_shadow"
android:layout_width="@dimen/toolbar_button_width"
android:src="@drawable/btn_toolbar_home" android:src="@drawable/btn_toolbar_home"
android:contentDescription="@string/accessibility_toolbar_btn_home" android:contentDescription="@string/accessibility_toolbar_btn_home"
android:visibility="gone" /> android:visibility="gone" />
...@@ -48,16 +45,12 @@ ...@@ -48,16 +45,12 @@
<org.chromium.chrome.browser.widget.TintedImageButton <org.chromium.chrome.browser.widget.TintedImageButton
android:id="@+id/expand_sheet_button" android:id="@+id/expand_sheet_button"
style="@style/ToolbarButton" style="@style/ToolbarButton"
android:layout_height="@dimen/toolbar_height_no_shadow"
android:layout_width="@dimen/toolbar_button_width"
android:src="@drawable/ic_collapsed" android:src="@drawable/ic_collapsed"
android:contentDescription="@string/accessibility_toolbar_btn_expand" android:contentDescription="@string/accessibility_toolbar_btn_expand"
android:visibility="gone" /> android:visibility="gone" />
<ImageButton android:id="@+id/tab_switcher_button" <ImageButton android:id="@+id/tab_switcher_button"
style="@style/ToolbarButton" style="@style/ToolbarButton"
android:layout_height="@dimen/toolbar_height_no_shadow"
android:layout_width="@dimen/toolbar_button_width"
android:layout_gravity="top" android:layout_gravity="top"
android:contentDescription="@string/accessibility_toolbar_btn_tabswitcher_toggle_default" /> android:contentDescription="@string/accessibility_toolbar_btn_tabswitcher_toggle_default" />
...@@ -69,16 +62,12 @@ ...@@ -69,16 +62,12 @@
<org.chromium.chrome.browser.widget.TintedImageButton <org.chromium.chrome.browser.widget.TintedImageButton
android:id="@+id/menu_button" android:id="@+id/menu_button"
style="@style/ToolbarMenuButtonPhone" style="@style/ToolbarMenuButtonPhone"
android:layout_height="@dimen/toolbar_height_no_shadow"
android:layout_width="@dimen/toolbar_menu_button_width"
android:src="@drawable/ic_more_vert_black_24dp" android:src="@drawable/ic_more_vert_black_24dp"
android:contentDescription="@string/accessibility_toolbar_btn_menu" /> android:contentDescription="@string/accessibility_toolbar_btn_menu" />
<ImageView <ImageView
android:id="@+id/menu_badge" android:id="@+id/menu_badge"
style="@style/ToolbarMenuButtonPhone" style="@style/ToolbarMenuButtonPhone"
android:layout_height="@dimen/toolbar_height_no_shadow"
android:layout_width="@dimen/toolbar_menu_button_width"
android:src="@drawable/badge_update_dark" android:src="@drawable/badge_update_dark"
android:contentDescription="@null" android:contentDescription="@null"
android:importantForAccessibility="no" android:importantForAccessibility="no"
......
...@@ -23,8 +23,6 @@ ...@@ -23,8 +23,6 @@
<org.chromium.chrome.browser.toolbar.HomePageButton <org.chromium.chrome.browser.toolbar.HomePageButton
android:id="@+id/home_button" android:id="@+id/home_button"
style="@style/ToolbarButton" style="@style/ToolbarButton"
android:layout_height="@dimen/toolbar_height_no_shadow"
android:layout_width="@dimen/toolbar_button_width"
android:src="@drawable/btn_toolbar_home" android:src="@drawable/btn_toolbar_home"
android:contentDescription="@string/accessibility_toolbar_btn_home" android:contentDescription="@string/accessibility_toolbar_btn_home"
android:visibility="gone" /> android:visibility="gone" />
...@@ -32,24 +30,18 @@ ...@@ -32,24 +30,18 @@
<org.chromium.chrome.browser.widget.TintedImageButton <org.chromium.chrome.browser.widget.TintedImageButton
android:id="@+id/back_button" android:id="@+id/back_button"
style="@style/ToolbarButton" style="@style/ToolbarButton"
android:layout_height="@dimen/toolbar_height_no_shadow"
android:layout_width="@dimen/toolbar_button_width"
android:src="@drawable/btn_back" android:src="@drawable/btn_back"
android:contentDescription="@string/accessibility_toolbar_btn_back" /> android:contentDescription="@string/accessibility_toolbar_btn_back" />
<org.chromium.chrome.browser.widget.TintedImageButton <org.chromium.chrome.browser.widget.TintedImageButton
android:id="@+id/forward_button" android:id="@+id/forward_button"
style="@style/ToolbarButton" style="@style/ToolbarButton"
android:layout_height="@dimen/toolbar_height_no_shadow"
android:layout_width="@dimen/toolbar_button_width"
android:src="@drawable/btn_forward" android:src="@drawable/btn_forward"
android:contentDescription="@string/accessibility_toolbar_btn_forward" /> android:contentDescription="@string/accessibility_toolbar_btn_forward" />
<org.chromium.chrome.browser.widget.TintedImageButton <org.chromium.chrome.browser.widget.TintedImageButton
android:id="@+id/refresh_button" android:id="@+id/refresh_button"
style="@style/ToolbarButton" style="@style/ToolbarButton"
android:layout_height="@dimen/toolbar_height_no_shadow"
android:layout_width="@dimen/toolbar_button_width"
android:src="@drawable/btn_reload_stop" android:src="@drawable/btn_reload_stop"
android:contentDescription="@string/accessibility_btn_refresh" /> android:contentDescription="@string/accessibility_btn_refresh" />
...@@ -68,8 +60,6 @@ ...@@ -68,8 +60,6 @@
<ImageButton <ImageButton
android:id="@+id/tab_switcher_button" android:id="@+id/tab_switcher_button"
style="@style/ToolbarButton" style="@style/ToolbarButton"
android:layout_height="@dimen/toolbar_height_no_shadow"
android:layout_width="@dimen/toolbar_button_width"
android:contentDescription="@string/accessibility_toolbar_btn_tabswitcher_toggle_default" android:contentDescription="@string/accessibility_toolbar_btn_tabswitcher_toggle_default"
android:visibility="gone" /> android:visibility="gone" />
...@@ -81,16 +71,12 @@ ...@@ -81,16 +71,12 @@
<org.chromium.chrome.browser.widget.TintedImageButton <org.chromium.chrome.browser.widget.TintedImageButton
android:id="@+id/menu_button" android:id="@+id/menu_button"
style="@style/ToolbarMenuButtonTablet" style="@style/ToolbarMenuButtonTablet"
android:layout_height="@dimen/toolbar_height_no_shadow"
android:layout_width="@dimen/toolbar_menu_button_width"
android:src="@drawable/ic_more_vert_black_24dp" android:src="@drawable/ic_more_vert_black_24dp"
android:contentDescription="@string/accessibility_toolbar_btn_menu" /> android:contentDescription="@string/accessibility_toolbar_btn_menu" />
<ImageView <ImageView
android:id="@+id/menu_badge" android:id="@+id/menu_badge"
style="@style/ToolbarMenuButtonTablet" style="@style/ToolbarMenuButtonTablet"
android:layout_height="@dimen/toolbar_height_no_shadow"
android:layout_width="@dimen/toolbar_menu_button_width"
android:src="@drawable/badge_update_dark" android:src="@drawable/badge_update_dark"
android:contentDescription="@null" android:contentDescription="@null"
android:importantForAccessibility="no" android:importantForAccessibility="no"
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
<dimen name="tab_strip_and_toolbar_height">96dp</dimen> <dimen name="tab_strip_and_toolbar_height">96dp</dimen>
<dimen name="location_bar_icon_width">40dp</dimen> <dimen name="location_bar_icon_width">40dp</dimen>
<dimen name="toolbar_menu_button_width">43dp</dimen>
<!-- NTP dimensions --> <!-- NTP dimensions -->
<dimen name="ntp_logo_height">180dp</dimen> <dimen name="ntp_logo_height">180dp</dimen>
......
...@@ -597,14 +597,18 @@ ...@@ -597,14 +597,18 @@
</style> </style>
<style name="ToolbarButton"> <style name="ToolbarButton">
<item name="android:background">?attr/selectableItemBackground</item> <item name="android:background">?attr/selectableItemBackground</item>
<item name="android:layout_width">@dimen/toolbar_button_width</item>
<item name="android:layout_height">56dp</item>
<item name="android:scaleType">center</item> <item name="android:scaleType">center</item>
</style> </style>
<style name="ToolbarMenuButtonPhone" parent="ToolbarButton"> <style name="ToolbarMenuButtonPhone" parent="ToolbarButton">
<item name="android:layout_gravity">top</item> <item name="android:layout_gravity">top</item>
<item name="android:layout_width">42dp</item>
<item name="android:paddingEnd">4dp</item> <item name="android:paddingEnd">4dp</item>
<item name="android:background">@null</item> <item name="android:background">@null</item>
</style> </style>
<style name="ToolbarMenuButtonTablet" parent="ToolbarButton"> <style name="ToolbarMenuButtonTablet" parent="ToolbarButton">
<item name="android:layout_width">43dp</item>
<item name="android:paddingEnd">3.5dp</item> <item name="android:paddingEnd">3.5dp</item>
</style> </style>
<style name="AppMenuItem"> <style name="AppMenuItem">
......
...@@ -241,7 +241,6 @@ ...@@ -241,7 +241,6 @@
<dimen name="toolbar_shadow_height">8dp</dimen> <dimen name="toolbar_shadow_height">8dp</dimen>
<dimen name="toolbar_progress_bar_height">2dp</dimen> <dimen name="toolbar_progress_bar_height">2dp</dimen>
<dimen name="toolbar_button_width">48dp</dimen> <dimen name="toolbar_button_width">48dp</dimen>
<dimen name="toolbar_menu_button_width">42dp</dimen>
<dimen name="toolbar_handle_height">3dp</dimen> <dimen name="toolbar_handle_height">3dp</dimen>
<dimen name="toolbar_handle_width">20dp</dimen> <dimen name="toolbar_handle_width">20dp</dimen>
<dimen name="toolbar_handle_corner_radius">1.5dp</dimen> <dimen name="toolbar_handle_corner_radius">1.5dp</dimen>
......
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