WIP: Bug 1314902 - Replace tabs/private tabs icon with VectorDrawable draft
authorAndrzej Hunt <ahunt@mozilla.com>
Fri, 21 Oct 2016 16:04:14 -0700
changeset 433294 e9ed8bd813649776a7eb7c67275abdb1dd2f8d12
parent 433293 856ea6e0e5bb0c905a74960359c816094067ab96
child 535848 b57ec3a6211e48bc4409652c8de2e54ffaa39aec
push id34531
push userahunt@mozilla.com
push dateThu, 03 Nov 2016 10:54:02 +0000
bugs1314902
milestone52.0a1
WIP: Bug 1314902 - Replace tabs/private tabs icon with VectorDrawable TODO: - Verify that we want to use a different private mask than before? - Create filled tab icon, verify that we want a taller icon? MozReview-Commit-ID: HSdcmTuYp7s
mobile/android/base/java/org/mozilla/gecko/tabs/TabsPanel.java
mobile/android/base/java/org/mozilla/gecko/widget/IconTabWidget.java
mobile/android/base/resources/drawable-hdpi/tabs_normal.png
mobile/android/base/resources/drawable-hdpi/tabs_private.png
mobile/android/base/resources/drawable-xhdpi/tabs_normal.png
mobile/android/base/resources/drawable-xhdpi/tabs_private.png
--- a/mobile/android/base/java/org/mozilla/gecko/tabs/TabsPanel.java
+++ b/mobile/android/base/java/org/mozilla/gecko/tabs/TabsPanel.java
@@ -134,19 +134,19 @@ public class TabsPanel extends LinearLay
             @Override
             public void onClick(View v) {
                 TabsPanel.this.addTab();
             }
         });
 
         mTabWidget = (IconTabWidget) findViewById(R.id.tab_widget);
 
-        mTabWidget.addTab(R.drawable.tabs_normal, R.string.tabs_normal);
+        mTabWidget.addTab(R.drawable.as_tab, R.string.tabs_normal);
         final ThemedImageButton privateTabsPanel =
-                (ThemedImageButton) mTabWidget.addTab(R.drawable.tabs_private, R.string.tabs_private);
+                (ThemedImageButton) mTabWidget.addTab(R.drawable.as_private, R.string.tabs_private);
         privateTabsPanel.setPrivateMode(true);
 
         if (!Restrictions.isAllowed(mContext, Restrictable.PRIVATE_BROWSING)) {
             mTabWidget.setVisibility(View.GONE);
         }
 
         mTabWidget.setTabSelectionListener(this);
 
--- a/mobile/android/base/java/org/mozilla/gecko/widget/IconTabWidget.java
+++ b/mobile/android/base/java/org/mozilla/gecko/widget/IconTabWidget.java
@@ -1,18 +1,20 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko.widget;
 
 import org.mozilla.gecko.R;
+import org.mozilla.gecko.util.DrawableUtil;
 
 import android.content.Context;
 import android.content.res.TypedArray;
+import android.graphics.Color;
 import android.graphics.drawable.Drawable;
 import android.util.AttributeSet;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.widget.ImageButton;
 import android.widget.TabWidget;
 import android.widget.TextView;
 
@@ -35,18 +37,21 @@ public class IconTabWidget extends TabWi
 
         if (mButtonLayoutId == 0) {
             throw new RuntimeException("You must supply layout attribute");
         }
     }
 
     public View addTab(final int imageResId, final int stringResId) {
         View button = LayoutInflater.from(getContext()).inflate(mButtonLayoutId, this, false);
+
+        // Tint the icons white with some transparency
+        Drawable tintedDrawable = DrawableUtil.tintDrawable(getContext(), imageResId, 0x66FFFFFF);
         if (mIsIcon) {
-            ((ImageButton) button).setImageResource(imageResId);
+            ((ImageButton) button).setImageDrawable(tintedDrawable);
             button.setContentDescription(getContext().getString(stringResId));
         } else {
             ((TextView) button).setText(getContext().getString(stringResId));
         }
 
         addView(button);
         button.setOnClickListener(new TabClickListener(getTabCount() - 1));
         button.setOnFocusChangeListener(this);
deleted file mode 100644
index 49b4ec8bda41434fe0f6ba92048afa68c8fb96e9..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 50ff113093e11639a741d85aae8a262d28d5e1bb..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index f76b0221c3b416f81949acf4d7b130ee2cfd68f6..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 14a3f4b79e8c56189b44436dcde2b4fc8869eb17..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001