Bug 1400164 - Part 1: Provide a getter method for tint colors of themed widgets. r=nechen
MozReview-Commit-ID: 2YWv9hjhAVr
--- a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedEditText.java
+++ b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedEditText.java
@@ -161,12 +161,16 @@ public class ThemedEditText extends andr
theme.removeListener(this);
}
}
public ColorDrawable getColorDrawable(int id) {
return new ColorDrawable(ContextCompat.getColor(getContext(), id));
}
+ public ColorStateList getDrawableColors() {
+ return drawableColors;
+ }
+
protected LightweightTheme getTheme() {
return theme;
}
}
--- a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedFrameLayout.java
+++ b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedFrameLayout.java
@@ -161,12 +161,16 @@ public class ThemedFrameLayout extends a
theme.removeListener(this);
}
}
public ColorDrawable getColorDrawable(int id) {
return new ColorDrawable(ContextCompat.getColor(getContext(), id));
}
+ public ColorStateList getDrawableColors() {
+ return drawableColors;
+ }
+
protected LightweightTheme getTheme() {
return theme;
}
}
--- a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedImageButton.java
+++ b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedImageButton.java
@@ -189,12 +189,16 @@ public class ThemedImageButton extends a
}
super.setImageDrawable(tintedDrawable);
}
public ColorDrawable getColorDrawable(int id) {
return new ColorDrawable(ContextCompat.getColor(getContext(), id));
}
+ public ColorStateList getDrawableColors() {
+ return drawableColors;
+ }
+
protected LightweightTheme getTheme() {
return theme;
}
}
--- a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedImageView.java
+++ b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedImageView.java
@@ -188,12 +188,16 @@ public class ThemedImageView extends and
}
super.setImageDrawable(tintedDrawable);
}
public ColorDrawable getColorDrawable(int id) {
return new ColorDrawable(ContextCompat.getColor(getContext(), id));
}
+ public ColorStateList getDrawableColors() {
+ return drawableColors;
+ }
+
protected LightweightTheme getTheme() {
return theme;
}
}
--- a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedLinearLayout.java
+++ b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedLinearLayout.java
@@ -156,12 +156,16 @@ public class ThemedLinearLayout extends
theme.removeListener(this);
}
}
public ColorDrawable getColorDrawable(int id) {
return new ColorDrawable(ContextCompat.getColor(getContext(), id));
}
+ public ColorStateList getDrawableColors() {
+ return drawableColors;
+ }
+
protected LightweightTheme getTheme() {
return theme;
}
}
--- a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedListView.java
+++ b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedListView.java
@@ -161,12 +161,16 @@ public class ThemedListView extends andr
theme.removeListener(this);
}
}
public ColorDrawable getColorDrawable(int id) {
return new ColorDrawable(ContextCompat.getColor(getContext(), id));
}
+ public ColorStateList getDrawableColors() {
+ return drawableColors;
+ }
+
protected LightweightTheme getTheme() {
return theme;
}
}
--- a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedProgressBar.java
+++ b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedProgressBar.java
@@ -161,12 +161,16 @@ public class ThemedProgressBar extends a
theme.removeListener(this);
}
}
public ColorDrawable getColorDrawable(int id) {
return new ColorDrawable(ContextCompat.getColor(getContext(), id));
}
+ public ColorStateList getDrawableColors() {
+ return drawableColors;
+ }
+
protected LightweightTheme getTheme() {
return theme;
}
}
--- a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedRelativeLayout.java
+++ b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedRelativeLayout.java
@@ -161,12 +161,16 @@ public class ThemedRelativeLayout extend
theme.removeListener(this);
}
}
public ColorDrawable getColorDrawable(int id) {
return new ColorDrawable(ContextCompat.getColor(getContext(), id));
}
+ public ColorStateList getDrawableColors() {
+ return drawableColors;
+ }
+
protected LightweightTheme getTheme() {
return theme;
}
}
--- a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedTextSwitcher.java
+++ b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedTextSwitcher.java
@@ -156,12 +156,16 @@ public class ThemedTextSwitcher extends
theme.removeListener(this);
}
}
public ColorDrawable getColorDrawable(int id) {
return new ColorDrawable(ContextCompat.getColor(getContext(), id));
}
+ public ColorStateList getDrawableColors() {
+ return drawableColors;
+ }
+
protected LightweightTheme getTheme() {
return theme;
}
}
--- a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedTextView.java
+++ b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedTextView.java
@@ -161,12 +161,16 @@ public class ThemedTextView extends andr
theme.removeListener(this);
}
}
public ColorDrawable getColorDrawable(int id) {
return new ColorDrawable(ContextCompat.getColor(getContext(), id));
}
+ public ColorStateList getDrawableColors() {
+ return drawableColors;
+ }
+
protected LightweightTheme getTheme() {
return theme;
}
}
--- a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedView.java
+++ b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedView.java
@@ -161,12 +161,16 @@ public class ThemedView extends android.
theme.removeListener(this);
}
}
public ColorDrawable getColorDrawable(int id) {
return new ColorDrawable(ContextCompat.getColor(getContext(), id));
}
+ public ColorStateList getDrawableColors() {
+ return drawableColors;
+ }
+
protected LightweightTheme getTheme() {
return theme;
}
}
--- a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedView.java.frag
+++ b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedView.java.frag
@@ -200,12 +200,16 @@ public class Themed@VIEW_NAME_SUFFIX@ ex
super.setImageDrawable(tintedDrawable);
}
//#endif
public ColorDrawable getColorDrawable(int id) {
return new ColorDrawable(ContextCompat.getColor(getContext(), id));
}
+ public ColorStateList getDrawableColors() {
+ return drawableColors;
+ }
+
protected LightweightTheme getTheme() {
return theme;
}
}