From ee99ee376b8b808d28c2f1336fc5fcd650a22202 Mon Sep 17 00:00:00 2001 From: AbilashK Date: Thu, 25 Feb 2016 16:54:43 -0800 Subject: [PATCH] Fix android's image tintColor prop when used with alpha Summary:Fixes https://github.com/facebook/react-native/issues/6075 UIExplorer example has been tested with 4 levels of opacity(100,75,50,25) ![selection_029](https://cloud.githubusercontent.com/assets/11550281/13228124/31c85dcc-d9c0-11e5-90e3-3938e155d5a2.png) Closes https://github.com/facebook/react-native/pull/6090 Differential Revision: D2979913 Pulled By: mkonicek fb-gh-sync-id: ff30dec853935a059979096d9b1da9088d146249 shipit-source-id: ff30dec853935a059979096d9b1da9088d146249 --- .../java/com/facebook/react/views/image/ReactImageManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageManager.java index 4231d207d9aa64..6ebd2e8c8cdab7 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageManager.java @@ -14,6 +14,7 @@ import java.util.Map; import android.graphics.Color; +import android.graphics.PorterDuff.Mode; import com.facebook.drawee.backends.pipeline.Fresco; import com.facebook.drawee.controller.AbstractDraweeControllerBuilder; @@ -120,7 +121,7 @@ public void setTintColor(ReactImageView view, @Nullable Integer tintColor) { if (tintColor == null) { view.clearColorFilter(); } else { - view.setColorFilter(tintColor); + view.setColorFilter(tintColor, Mode.SRC_IN); } }