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
--- 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