Bug 1066253 - Part 1: Remove favicon from BrowserToolbar. r=lucasr

This commit is contained in:
Michael Comella
2014-09-22 14:44:39 -07:00
parent 44dafc1ac7
commit 7dde7cd38f
2 changed files with 26 additions and 5 deletions

View File

@@ -45,10 +45,15 @@
android:layout_toRightOf="@id/back"
android:layout_toLeftOf="@id/menu_items"/>
<!-- We add extra padding to the left side to compensate for site security's
negative margin, which is used to move the site security icon closer to
the favicon in toolbar_display_layout. -->
<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:layout_toLeftOf="@id/menu_items"
android:paddingLeft="8dip"
android:paddingRight="4dip"/>
<LinearLayout android:id="@+id/menu_items"
android:layout_width="wrap_content"

View File

@@ -12,6 +12,7 @@ import java.util.List;
import org.mozilla.gecko.AboutPages;
import org.mozilla.gecko.AppConstants.Versions;
import org.mozilla.gecko.BrowserApp;
import org.mozilla.gecko.NewTabletUI;
import org.mozilla.gecko.R;
import org.mozilla.gecko.SiteIdentity;
import org.mozilla.gecko.SiteIdentity.SecurityMode;
@@ -146,10 +147,16 @@ public class ToolbarDisplayLayout extends ThemedLinearLayout
mPrivateDomainColor = new ForegroundColorSpan(res.getColor(R.color.url_bar_domaintext_private));
mFavicon = (ImageButton) findViewById(R.id.favicon);
if (NewTabletUI.isEnabled(context)) {
// We don't show favicons in the toolbar on new tablet.
// TODO: removeView(mFavicon);
mFavicon.setVisibility(View.GONE);
} else {
if (Versions.feature16Plus) {
mFavicon.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
}
mFaviconSize = Math.round(res.getDimension(R.dimen.browser_toolbar_favicon_size));
}
mSiteSecurity = (ImageButton) findViewById(R.id.site_security);
mSiteSecurityVisible = (mSiteSecurity.getVisibility() == View.VISIBLE);
@@ -351,6 +358,11 @@ public class ToolbarDisplayLayout extends ThemedLinearLayout
}
private void updateFavicon(Tab tab) {
if (NewTabletUI.isEnabled(getContext())) {
// We don't display favicons in the toolbar for the new Tablet UI.
return;
}
if (tab == null) {
mFavicon.setImageDrawable(null);
return;
@@ -489,7 +501,11 @@ public class ToolbarDisplayLayout extends ThemedLinearLayout
}
View getDoorHangerAnchor() {
if (!NewTabletUI.isEnabled(getContext())) {
return mFavicon;
} else {
return mSiteSecurity;
}
}
void prepareForwardAnimation(PropertyAnimator anim, ForwardButtonAnimation animation, int width) {