Bug 1066253 - Part 1: Remove favicon from BrowserToolbar. r=lucasr
This commit is contained in:
@@ -45,10 +45,15 @@
|
|||||||
android:layout_toRightOf="@id/back"
|
android:layout_toRightOf="@id/back"
|
||||||
android:layout_toLeftOf="@id/menu_items"/>
|
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"
|
<org.mozilla.gecko.toolbar.ToolbarDisplayLayout android:id="@+id/display_layout"
|
||||||
style="@style/UrlBar.Button.Container"
|
style="@style/UrlBar.Button.Container"
|
||||||
android:layout_toRightOf="@id/back"
|
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"
|
<LinearLayout android:id="@+id/menu_items"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import java.util.List;
|
|||||||
import org.mozilla.gecko.AboutPages;
|
import org.mozilla.gecko.AboutPages;
|
||||||
import org.mozilla.gecko.AppConstants.Versions;
|
import org.mozilla.gecko.AppConstants.Versions;
|
||||||
import org.mozilla.gecko.BrowserApp;
|
import org.mozilla.gecko.BrowserApp;
|
||||||
|
import org.mozilla.gecko.NewTabletUI;
|
||||||
import org.mozilla.gecko.R;
|
import org.mozilla.gecko.R;
|
||||||
import org.mozilla.gecko.SiteIdentity;
|
import org.mozilla.gecko.SiteIdentity;
|
||||||
import org.mozilla.gecko.SiteIdentity.SecurityMode;
|
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));
|
mPrivateDomainColor = new ForegroundColorSpan(res.getColor(R.color.url_bar_domaintext_private));
|
||||||
|
|
||||||
mFavicon = (ImageButton) findViewById(R.id.favicon);
|
mFavicon = (ImageButton) findViewById(R.id.favicon);
|
||||||
if (Versions.feature16Plus) {
|
if (NewTabletUI.isEnabled(context)) {
|
||||||
mFavicon.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
|
// 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));
|
||||||
}
|
}
|
||||||
mFaviconSize = Math.round(res.getDimension(R.dimen.browser_toolbar_favicon_size));
|
|
||||||
|
|
||||||
mSiteSecurity = (ImageButton) findViewById(R.id.site_security);
|
mSiteSecurity = (ImageButton) findViewById(R.id.site_security);
|
||||||
mSiteSecurityVisible = (mSiteSecurity.getVisibility() == View.VISIBLE);
|
mSiteSecurityVisible = (mSiteSecurity.getVisibility() == View.VISIBLE);
|
||||||
@@ -351,6 +358,11 @@ public class ToolbarDisplayLayout extends ThemedLinearLayout
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateFavicon(Tab tab) {
|
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) {
|
if (tab == null) {
|
||||||
mFavicon.setImageDrawable(null);
|
mFavicon.setImageDrawable(null);
|
||||||
return;
|
return;
|
||||||
@@ -489,7 +501,11 @@ public class ToolbarDisplayLayout extends ThemedLinearLayout
|
|||||||
}
|
}
|
||||||
|
|
||||||
View getDoorHangerAnchor() {
|
View getDoorHangerAnchor() {
|
||||||
return mFavicon;
|
if (!NewTabletUI.isEnabled(getContext())) {
|
||||||
|
return mFavicon;
|
||||||
|
} else {
|
||||||
|
return mSiteSecurity;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void prepareForwardAnimation(PropertyAnimator anim, ForwardButtonAnimation animation, int width) {
|
void prepareForwardAnimation(PropertyAnimator anim, ForwardButtonAnimation animation, int width) {
|
||||||
|
|||||||
Reference in New Issue
Block a user