Commit 358ed727 authored by Theresa Wellington's avatar Theresa Wellington Committed by Commit Bot

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