Bug 1377294 - Let Site-Identity becomes theme-able r=jwu

In Australis flavor, it use same color then user should not aware of any
changes.

In Photon-flaor, its style use UrlBar.Button to avoid involving tint color list.
In current design, we should not tint color for some drawable such as
Lock.

MozReview-Commit-ID: PSuCbNPKR7

--HG--
extra : rebase_source : 088b7a4d78ffcb02267b24c06eb7a4e9e08b1ab1
This commit is contained in:
Julian_Chu 2017-06-22 13:54:30 +08:00
Родитель 91c053d3f8
Коммит 4a47fadca4
3 изменённых файлов: 14 добавлений и 5 удалений

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

@ -10,7 +10,7 @@
we add a bottom margin to align their bottoms.
Site security icon must have exact position and size as search icon in
edit layout -->
<ImageButton android:id="@+id/site_security"
<org.mozilla.gecko.widget.themed.ThemedImageButton android:id="@+id/site_security"
style="@style/UrlBar.ImageButton"
android:layout_width="@dimen/browser_toolbar_site_security_width"
android:layout_height="@dimen/browser_toolbar_site_security_height"

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

@ -11,15 +11,16 @@
we add a bottom margin to align their bottoms.
Site security icon must have exact position and size as search icon in
edit layout -->
<ImageButton
<org.mozilla.gecko.widget.themed.ThemedImageButton
android:id="@+id/site_security"
style="@style/UrlBar.ImageButton"
style="@style/UrlBar.Button"
android:layout_width="@dimen/browser_toolbar_site_security_width"
android:layout_height="@dimen/browser_toolbar_site_security_height"
android:layout_gravity="center_vertical"
android:layout_marginBottom="@dimen/browser_toolbar_site_security_margin_bottom"
android:layout_marginEnd="@dimen/browser_toolbar_site_security_margin_end"
android:layout_marginRight="@dimen/browser_toolbar_site_security_margin_end"
android:background="@android:color/transparent"
android:contentDescription="@string/site_security"
android:paddingBottom="@dimen/browser_toolbar_site_security_padding_vertical"
android:paddingEnd="@dimen/browser_toolbar_site_security_padding_horizontal"

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

@ -24,6 +24,7 @@ import org.mozilla.gecko.Experiments;
import org.mozilla.gecko.util.HardwareUtils;
import org.mozilla.gecko.util.StringUtils;
import org.mozilla.gecko.util.ViewUtil;
import org.mozilla.gecko.widget.themed.ThemedImageButton;
import org.mozilla.gecko.widget.themed.ThemedLinearLayout;
import org.mozilla.gecko.widget.themed.ThemedTextView;
@ -103,7 +104,7 @@ public class ToolbarDisplayLayout extends ThemedLinearLayout {
private ToolbarPrefs mPrefs;
private OnTitleChangeListener mTitleChangeListener;
private final ImageButton mSiteSecurity;
private final ThemedImageButton mSiteSecurity;
private final ImageButton mStop;
private OnStopListener mStopListener;
@ -151,7 +152,7 @@ public class ToolbarDisplayLayout extends ThemedLinearLayout {
mPrivateDomainColorSpan = new ForegroundColorSpan(ContextCompat.getColor(context, R.color.url_bar_domaintext_private));
mCertificateOwnerColorSpan = new ForegroundColorSpan(ContextCompat.getColor(context, R.color.affirmative_green));
mSiteSecurity = (ImageButton) findViewById(R.id.site_security);
mSiteSecurity = (ThemedImageButton) findViewById(R.id.site_security);
mSiteIdentityPopup = new SiteIdentityPopup(mActivity);
mSiteIdentityPopup.setAnchor(this);
@ -161,6 +162,13 @@ public class ToolbarDisplayLayout extends ThemedLinearLayout {
mPageActionLayout = (PageActionLayout) findViewById(R.id.page_action_layout);
}
@Override
public void setPrivateMode(boolean isPrivate) {
super.setPrivateMode(isPrivate);
mSiteSecurity.setPrivateMode(isPrivate);
}
@Override
public void onAttachedToWindow() {
super.onAttachedToWindow();