Bug 1071267 - Part 3: Create large tappable margin for site security.

This commit is contained in:
Michael Comella 2014-10-08 17:48:32 -07:00
Родитель ed3b4f3c5e
Коммит e186ad154f
3 изменённых файлов: 12 добавлений и 4 удалений

Просмотреть файл

@ -43,12 +43,12 @@
android:layout_toRightOf="@id/back"
android:layout_toLeftOf="@id/menu_items"/>
<!-- Values of marginLeft are used to animate the forward button so don't change its value. -->
<!-- Note: * Values of marginLeft are used to animate the forward button so don't change its value.
* We set the padding on the site security icon to increase its tappable area. -->
<org.mozilla.gecko.toolbar.ToolbarDisplayLayout android:id="@+id/display_layout"
style="@style/UrlBar.Button.Container"
android:layout_toRightOf="@id/back"
android:layout_toLeftOf="@id/menu_items"
android:paddingLeft="6dip"
android:paddingRight="4dip"/>
<LinearLayout android:id="@+id/menu_items"

Просмотреть файл

@ -23,8 +23,11 @@
<dimen name="new_tablet_tab_strip_favicon_size">16dp</dimen>
<dimen name="new_tablet_forward_default_offset">-6dp</dimen>
<dimen name="new_tablet_site_security_height">60dp</dimen>
<dimen name="new_tablet_site_security_width">18dp</dimen>
<dimen name="new_tablet_site_security_width">34dp</dimen>
<!-- We primarily use padding (instead of margins) to increase the hit area. -->
<dimen name="new_tablet_site_security_padding_vertical">21dp</dimen>
<dimen name="new_tablet_site_security_padding_horizontal">8dp</dimen>
<dimen name="new_tablet_site_security_right_margin">1dp</dimen>
<dimen name="new_tablet_browser_toolbar_height">60dp</dimen>
<dimen name="new_tablet_browser_toolbar_menu_item_width">56dp</dimen>
<!-- Padding combines with an 18dp image to form the menu item width and height. -->

Просмотреть файл

@ -161,10 +161,15 @@ public class ToolbarDisplayLayout extends ThemedLinearLayout
(LinearLayout.LayoutParams) mSiteSecurity.getLayoutParams();
lp.height = res.getDimensionPixelSize(R.dimen.new_tablet_site_security_height);
lp.width = res.getDimensionPixelSize(R.dimen.new_tablet_site_security_width);
// TODO: Override a common static value when new tablet is standard.
lp.rightMargin = res.getDimensionPixelSize(R.dimen.new_tablet_site_security_right_margin);
mSiteSecurity.setLayoutParams(lp);
final int siteSecurityVerticalPadding =
res.getDimensionPixelSize(R.dimen.new_tablet_site_security_padding_vertical);
mSiteSecurity.setPadding(0, siteSecurityVerticalPadding, 0, siteSecurityVerticalPadding);
final int siteSecurityHorizontalPadding =
res.getDimensionPixelSize(R.dimen.new_tablet_site_security_padding_horizontal);
mSiteSecurity.setPadding(siteSecurityHorizontalPadding, siteSecurityVerticalPadding,
siteSecurityHorizontalPadding, siteSecurityVerticalPadding);
// We don't show favicons in the toolbar on new tablet. Note that while we could
// null the favicon reference, we don't do so to avoid excessive null-checking.