From 0d88bb7c062199adb9cbb4d50774e5169ab949ef Mon Sep 17 00:00:00 2001 From: Vladimir Enchev Date: Mon, 11 Jan 2016 16:28:17 +0200 Subject: [PATCH] If only backgroundColor is set use setColorFilter --- ui/styling/background.android.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ui/styling/background.android.ts b/ui/styling/background.android.ts index 9c323ccbc..bdf46cee5 100644 --- a/ui/styling/background.android.ts +++ b/ui/styling/background.android.ts @@ -153,9 +153,17 @@ export module ad { var backgroundValue = v.style._getValue(style.backgroundInternalProperty); var borderWidth = v.borderWidth; - if (v.borderWidth !== 0 || v.borderRadius !== 0 || !backgroundValue.isEmpty()) { - var bkg = nativeView.getBackground(); + if (v.borderWidth === 0 && v.borderRadius === 0 && + !v.style._getValue(style.backgroundImageProperty) && + v.style._getValue(style.backgroundColorProperty)) { + let bkg = nativeView.getBackground(); + if (bkg && bkg.setColorFilter) { + bkg.setColorFilter(v.style._getValue(style.backgroundColorProperty).android, android.graphics.PorterDuff.Mode.SRC_IN); + } + } else if (v.borderWidth !== 0 || v.borderRadius !== 0 || !backgroundValue.isEmpty()) { + + let bkg = nativeView.getBackground(); if (!(bkg instanceof dts.ad.BorderDrawable)) { bkg = new dts.ad.BorderDrawable(); let viewClass = types.getClass(v);