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 2c564f3f912..6876472e1c5 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 @@ -178,10 +178,9 @@ public class ThemedImageButton extends android.widget.ImageButton private void setTintedImageDrawable(final Drawable drawable) { final Drawable tintedDrawable; if (drawableColors == null || R.id.bookmark == getId()) { + // NB: The bookmarked state uses a blue star, so this is a hack to keep it untinted. // NB: If we tint a drawable with a null ColorStateList, it will override // any existing colorFilters and tint... so don't! - - // NB: The bookmarked state uses a blue star, so this is a hack to keep it from being tinted. tintedDrawable = drawable; } else if (drawable == null) { tintedDrawable = null; 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 c391fd08fec..4c80243fc79 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 @@ -178,7 +178,7 @@ public class ThemedImageView extends android.widget.ImageView private void setTintedImageDrawable(final Drawable drawable) { final Drawable tintedDrawable; if (drawableColors == null) { - // If we tint a drawable with a null ColorStateList, it will override + // NB: If we tint a drawable with a null ColorStateList, it will override // any existing colorFilters and tint... so don't! tintedDrawable = drawable; } else if (drawable == null) { 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 f773a77b185..610be2c6735 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 @@ -183,8 +183,13 @@ public class Themed@VIEW_NAME_SUFFIX@ extends @BASE_TYPE@ private void setTintedImageDrawable(final Drawable drawable) { final Drawable tintedDrawable; +//#ifdef BOOKMARK_NO_TINT + if (drawableColors == null || R.id.bookmark == getId()) { + // NB: The bookmarked state uses a blue star, so this is a hack to keep it untinted. +//#else if (drawableColors == null) { - // If we tint a drawable with a null ColorStateList, it will override +//#endif + // NB: If we tint a drawable with a null ColorStateList, it will override // any existing colorFilters and tint... so don't! tintedDrawable = drawable; } else if (drawable == null) { diff --git a/mobile/android/base/java/org/mozilla/gecko/widget/themed/generate_themed_views.py b/mobile/android/base/java/org/mozilla/gecko/widget/themed/generate_themed_views.py index a9a1d514bbb..72e1ca2a311 100644 --- a/mobile/android/base/java/org/mozilla/gecko/widget/themed/generate_themed_views.py +++ b/mobile/android/base/java/org/mozilla/gecko/widget/themed/generate_themed_views.py @@ -12,7 +12,7 @@ This script runs the preprocessor on a input template and writes updated files into the source directory. To update the themed views, update the input template -(ThemedView.java.frag) and run the script. Use version control to +(ThemedView.java.frag) and run the script using 'mach python '. Use version control to examine the differences, and don't forget to commit the changes to the template and the outputs. ''' @@ -41,7 +41,8 @@ views = [ dict(VIEW_NAME_SUFFIX='ImageButton', BASE_TYPE='android.widget.ImageButton', STYLE_CONSTRUCTOR=1, - TINT_FOREGROUND_DRAWABLE=1), + TINT_FOREGROUND_DRAWABLE=1, + BOOKMARK_NO_TINT=1), dict(VIEW_NAME_SUFFIX='ImageView', BASE_TYPE='android.widget.ImageView', STYLE_CONSTRUCTOR=1,