Bug 1242624 - Use our color palette for toolbar and URL bar text. r=sebastian
authorKrishna <k.krish@yahoo.com>
Thu, 17 Mar 2016 01:25:49 +0800
changeset 289548 730802d0014eecf13e4d95668fc5265c416f7f9b
parent 289547 32d94241611f8d5946301096cb6ae50e5c6d0ecb
child 289549 2edb5ec1f8c2dcc63c26334bbb6b2bdfcbd01833
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssebastian
bugs1242624
milestone48.0a1
Bug 1242624 - Use our color palette for toolbar and URL bar text. r=sebastian
mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarDisplayLayout.java
mobile/android/base/resources/values/colors.xml
--- a/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarDisplayLayout.java
+++ b/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarDisplayLayout.java
@@ -120,16 +120,17 @@ public class ToolbarDisplayLayout extend
     private static final int LEVEL_LOCK_DISABLED = 4;
     // Levels for displaying Tracking Protection state icons.
     private static final int LEVEL_SHIELD_ENABLED = 5;
     private static final int LEVEL_SHIELD_DISABLED = 6;
     // Icon used for about:home
     private static final int LEVEL_SEARCH_ICON = 999;
 
     private final ForegroundColorSpan mUrlColorSpan;
+    private final ForegroundColorSpan mPrivateUrlColorSpan;
     private final ForegroundColorSpan mBlockedColorSpan;
     private final ForegroundColorSpan mDomainColorSpan;
     private final ForegroundColorSpan mPrivateDomainColorSpan;
     private final ForegroundColorSpan mCertificateOwnerColorSpan;
 
     public ToolbarDisplayLayout(Context context, AttributeSet attrs) {
         super(context, attrs);
         setOrientation(HORIZONTAL);
@@ -137,16 +138,17 @@ public class ToolbarDisplayLayout extend
         mActivity = (BrowserApp) context;
 
         LayoutInflater.from(context).inflate(R.layout.toolbar_display_layout, this);
 
         mTitle = (ThemedTextView) findViewById(R.id.url_bar_title);
         mTitlePadding = mTitle.getPaddingRight();
 
         mUrlColorSpan = new ForegroundColorSpan(ContextCompat.getColor(context, R.color.url_bar_urltext));
+        mPrivateUrlColorSpan = new ForegroundColorSpan(ContextCompat.getColor(context, R.color.url_bar_urltext_private));
         mBlockedColorSpan = new ForegroundColorSpan(ContextCompat.getColor(context, R.color.url_bar_blockedtext));
         mDomainColorSpan = new ForegroundColorSpan(ContextCompat.getColor(context, R.color.url_bar_domaintext));
         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);
 
         mSiteIdentityPopup = new SiteIdentityPopup(mActivity);
@@ -313,17 +315,17 @@ public class ToolbarDisplayLayout extend
         int index = url.indexOf(baseDomain);
         if (index == -1) {
             setTitle(url);
             return;
         }
 
         final SpannableStringBuilder builder = new SpannableStringBuilder(url);
 
-        builder.setSpan(mUrlColorSpan, 0, url.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE);
+        builder.setSpan(isPrivate ? mPrivateUrlColorSpan : mUrlColorSpan, 0, url.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE);
         builder.setSpan(isPrivate ? mPrivateDomainColorSpan : mDomainColorSpan,
                 index, index + baseDomain.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE);
 
         setTitle(builder);
     }
 
     private String stripAboutReaderURL(final String url) {
         if (!AboutPages.isAboutReader(url)) {
--- a/mobile/android/base/resources/values/colors.xml
+++ b/mobile/android/base/resources/values/colors.xml
@@ -103,19 +103,20 @@
   <color name="url_bar_text_highlight_pb">#FFD06BFF</color>
   <color name="tab_row_pressed">#4D000000</color>
 
   <color name="textbox_background">#FFF</color>
   <color name="textbox_background_disabled">#DDD</color>
   <color name="textbox_stroke">#000</color>
   <color name="textbox_stroke_disabled">#666</color>
 
-  <color name="url_bar_urltext">#A6A6A6</color>
-  <color name="url_bar_domaintext">#000</color>
-  <color name="url_bar_domaintext_private">#FFF</color>
+  <color name="url_bar_urltext">#AFB1B3</color>
+  <color name="url_bar_urltext_private">#777777</color>
+  <color name="url_bar_domaintext">#363B40</color>
+  <color name="url_bar_domaintext_private">#FFFFFF</color>
   <color name="url_bar_blockedtext">#b14646</color>
   <color name="url_bar_shadow">#12000000</color>
 
   <color name="panel_image_item_background">#D1D9E1</color>
   <color name="panel_icon_item_title_background">#32000000</color>
   <color name="panel_tab_text_normal">#FFBFBFBF</color>
 
   <!-- Remote tabs setup -->