From 0352c3f4a2dde1ba89621b149cca359a2b338879 Mon Sep 17 00:00:00 2001 From: Jing-wei Wu Date: Mon, 18 Sep 2017 11:07:39 +0800 Subject: [PATCH] Bug 1400164 - Part 1: Provide a getter method for tint colors of themed widgets. r=nechen MozReview-Commit-ID: 2YWv9hjhAVr --HG-- extra : rebase_source : 202335949ad30ee05b60b54b3d0db9df710dc19f --- .../java/org/mozilla/gecko/widget/themed/ThemedEditText.java | 4 ++++ .../org/mozilla/gecko/widget/themed/ThemedFrameLayout.java | 4 ++++ .../org/mozilla/gecko/widget/themed/ThemedImageButton.java | 4 ++++ .../java/org/mozilla/gecko/widget/themed/ThemedImageView.java | 4 ++++ .../org/mozilla/gecko/widget/themed/ThemedLinearLayout.java | 4 ++++ .../java/org/mozilla/gecko/widget/themed/ThemedListView.java | 4 ++++ .../org/mozilla/gecko/widget/themed/ThemedProgressBar.java | 4 ++++ .../org/mozilla/gecko/widget/themed/ThemedRelativeLayout.java | 4 ++++ .../org/mozilla/gecko/widget/themed/ThemedTextSwitcher.java | 4 ++++ .../java/org/mozilla/gecko/widget/themed/ThemedTextView.java | 4 ++++ .../base/java/org/mozilla/gecko/widget/themed/ThemedView.java | 4 ++++ .../java/org/mozilla/gecko/widget/themed/ThemedView.java.frag | 4 ++++ 12 files changed, 48 insertions(+) diff --git a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedEditText.java b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedEditText.java index 6f375af57f0e..639fb77c90a8 100644 --- a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedEditText.java +++ b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedEditText.java @@ -166,6 +166,10 @@ public class ThemedEditText extends android.widget.EditText return new ColorDrawable(ContextCompat.getColor(getContext(), id)); } + public ColorStateList getDrawableColors() { + return drawableColors; + } + protected LightweightTheme getTheme() { return theme; } diff --git a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedFrameLayout.java b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedFrameLayout.java index fa18cab83758..2631fed3c3ad 100644 --- a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedFrameLayout.java +++ b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedFrameLayout.java @@ -166,6 +166,10 @@ public class ThemedFrameLayout extends android.widget.FrameLayout return new ColorDrawable(ContextCompat.getColor(getContext(), id)); } + public ColorStateList getDrawableColors() { + return drawableColors; + } + protected LightweightTheme getTheme() { return theme; } diff --git a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedImageButton.java b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedImageButton.java index 8996990b9421..afeaaac5a63c 100644 --- a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedImageButton.java +++ b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedImageButton.java @@ -194,6 +194,10 @@ public class ThemedImageButton extends android.widget.ImageButton return new ColorDrawable(ContextCompat.getColor(getContext(), id)); } + public ColorStateList getDrawableColors() { + return drawableColors; + } + protected LightweightTheme getTheme() { return theme; } diff --git a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedImageView.java b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedImageView.java index 73fa5ffbf3c7..1904afed8cc7 100644 --- a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedImageView.java +++ b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedImageView.java @@ -193,6 +193,10 @@ public class ThemedImageView extends android.widget.ImageView return new ColorDrawable(ContextCompat.getColor(getContext(), id)); } + public ColorStateList getDrawableColors() { + return drawableColors; + } + protected LightweightTheme getTheme() { return theme; } diff --git a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedLinearLayout.java b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedLinearLayout.java index cb93085df1f2..ec4b2cff7755 100644 --- a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedLinearLayout.java +++ b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedLinearLayout.java @@ -161,6 +161,10 @@ public class ThemedLinearLayout extends android.widget.LinearLayout return new ColorDrawable(ContextCompat.getColor(getContext(), id)); } + public ColorStateList getDrawableColors() { + return drawableColors; + } + protected LightweightTheme getTheme() { return theme; } diff --git a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedListView.java b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedListView.java index 2213bcb18511..56c6a29b933d 100644 --- a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedListView.java +++ b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedListView.java @@ -166,6 +166,10 @@ public class ThemedListView extends android.widget.ListView return new ColorDrawable(ContextCompat.getColor(getContext(), id)); } + public ColorStateList getDrawableColors() { + return drawableColors; + } + protected LightweightTheme getTheme() { return theme; } diff --git a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedProgressBar.java b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedProgressBar.java index 3856c3b8f2fb..f22c313ab367 100644 --- a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedProgressBar.java +++ b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedProgressBar.java @@ -166,6 +166,10 @@ public class ThemedProgressBar extends android.widget.ProgressBar return new ColorDrawable(ContextCompat.getColor(getContext(), id)); } + public ColorStateList getDrawableColors() { + return drawableColors; + } + protected LightweightTheme getTheme() { return theme; } diff --git a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedRelativeLayout.java b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedRelativeLayout.java index 44c7fca14661..bdcd635d03cb 100644 --- a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedRelativeLayout.java +++ b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedRelativeLayout.java @@ -166,6 +166,10 @@ public class ThemedRelativeLayout extends android.widget.RelativeLayout return new ColorDrawable(ContextCompat.getColor(getContext(), id)); } + public ColorStateList getDrawableColors() { + return drawableColors; + } + protected LightweightTheme getTheme() { return theme; } diff --git a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedTextSwitcher.java b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedTextSwitcher.java index 8f077c378590..47a4436be6a7 100644 --- a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedTextSwitcher.java +++ b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedTextSwitcher.java @@ -161,6 +161,10 @@ public class ThemedTextSwitcher extends android.widget.TextSwitcher return new ColorDrawable(ContextCompat.getColor(getContext(), id)); } + public ColorStateList getDrawableColors() { + return drawableColors; + } + protected LightweightTheme getTheme() { return theme; } diff --git a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedTextView.java b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedTextView.java index 002aba56de6c..91727dc6071c 100644 --- a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedTextView.java +++ b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedTextView.java @@ -166,6 +166,10 @@ public class ThemedTextView extends android.widget.TextView return new ColorDrawable(ContextCompat.getColor(getContext(), id)); } + public ColorStateList getDrawableColors() { + return drawableColors; + } + protected LightweightTheme getTheme() { return theme; } diff --git a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedView.java b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedView.java index 1f566c32e3bf..8812186695cb 100644 --- a/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedView.java +++ b/mobile/android/base/java/org/mozilla/gecko/widget/themed/ThemedView.java @@ -166,6 +166,10 @@ public class ThemedView extends android.view.View return new ColorDrawable(ContextCompat.getColor(getContext(), id)); } + public ColorStateList getDrawableColors() { + return drawableColors; + } + protected LightweightTheme getTheme() { return theme; } diff --git 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 index 1b596b618e60..be081f9b76f8 100644 --- 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 @@ -205,6 +205,10 @@ public class Themed@VIEW_NAME_SUFFIX@ extends @BASE_TYPE@ return new ColorDrawable(ContextCompat.getColor(getContext(), id)); } + public ColorStateList getDrawableColors() { + return drawableColors; + } + protected LightweightTheme getTheme() { return theme; }