Bug 1070087 - Change tapped action bar buttons' visual to be smaller than the hit area. r=lucasr

This commit is contained in:
Michael Comella 2014-10-03 18:03:49 -07:00
parent f9ecf00426
commit 5c5eb70d0e
4 changed files with 51 additions and 2 deletions

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"
android:state_enabled="true">
<inset android:insetTop="@dimen/new_tablet_browser_toolbar_menu_item_inset_vertical"
android:insetBottom="@dimen/new_tablet_browser_toolbar_menu_item_inset_vertical"
android:insetLeft="@dimen/new_tablet_browser_toolbar_menu_item_inset_horizontal"
android:insetRight="@dimen/new_tablet_browser_toolbar_menu_item_inset_horizontal">
<shape android:shape="rectangle">
<solid android:color="#D7D7DC"/>
<corners android:radius="@dimen/new_tablet_browser_toolbar_menu_item_corner_radius"/>
</shape>
</inset>
</item>
<item android:state_focused="true"
android:state_pressed="false">
<inset android:insetTop="@dimen/new_tablet_browser_toolbar_menu_item_inset_vertical"
android:insetBottom="@dimen/new_tablet_browser_toolbar_menu_item_inset_vertical"
android:insetLeft="@dimen/new_tablet_browser_toolbar_menu_item_inset_horizontal"
android:insetRight="@dimen/new_tablet_browser_toolbar_menu_item_inset_horizontal">
<shape android:shape="rectangle">
<solid android:color="#C0C9D0"/>
<corners android:radius="@dimen/new_tablet_browser_toolbar_menu_item_corner_radius"/>
</shape>
</inset>
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="@android:color/transparent"/>
</shape>
</item>
</selector>

View File

@ -63,7 +63,7 @@
android:id="@+id/tabs"
style="@style/UrlBar.ImageButton.NewTablet"
android:layout_toLeftOf="@id/menu"
android:background="@drawable/action_bar_button"/>
android:background="@drawable/new_tablet_action_bar_button"/>
<!-- In a 56x60dp space, centering 24dp image will leave 16x18dp. -->
<org.mozilla.gecko.toolbar.TabCounter android:id="@+id/tabs_counter"
@ -84,7 +84,7 @@
android:layout_alignParentRight="true"
android:layout_marginRight="6dp"
android:contentDescription="@string/menu"
android:background="@drawable/action_bar_button"
android:background="@drawable/new_tablet_action_bar_button"
android:visibility="gone"/>
<org.mozilla.gecko.widget.ThemedImageView

View File

@ -86,7 +86,9 @@
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:scaleType">center</item>
<item name="android:background">@drawable/new_tablet_action_bar_button</item>
<!-- layout_* doesn't work here, likely because it's an ImageButton, so we use padding instead. -->
<item name="android:paddingTop">@dimen/new_tablet_browser_toolbar_menu_item_padding_vertical</item>
<item name="android:paddingBottom">@dimen/new_tablet_browser_toolbar_menu_item_padding_vertical</item>
<item name="android:paddingLeft">@dimen/new_tablet_browser_toolbar_menu_item_padding_horizontal</item>

View File

@ -27,6 +27,9 @@
<!-- Padding combines with an 18dp image to form the menu item width and height. -->
<dimen name="new_tablet_browser_toolbar_menu_item_padding_horizontal">19dp</dimen>
<dimen name="new_tablet_browser_toolbar_menu_item_padding_vertical">21dp</dimen>
<dimen name="new_tablet_browser_toolbar_menu_item_inset_vertical">5dp</dimen>
<dimen name="new_tablet_browser_toolbar_menu_item_inset_horizontal">3dp</dimen>
<dimen name="new_tablet_browser_toolbar_menu_item_corner_radius">5dp</dimen>
<dimen name="forward_default_offset">-13dip</dimen>
<!-- Dimensions used by Favicons and FaviconView -->