From cf2b3de662527670149daef7defccded66d0fb4e Mon Sep 17 00:00:00 2001 From: vakrilov Date: Fri, 24 Feb 2017 13:52:19 +0200 Subject: [PATCH] Fix: Background not re-drawing on android --- tns-core-modules/ui/styling/background.android.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tns-core-modules/ui/styling/background.android.ts b/tns-core-modules/ui/styling/background.android.ts index 90743cc9c..115494c1d 100644 --- a/tns-core-modules/ui/styling/background.android.ts +++ b/tns-core-modules/ui/styling/background.android.ts @@ -47,7 +47,9 @@ export module ad { && isNullOrUndefined(background.image) && !isNullOrUndefined(background.color)) { let backgroundColor = (backgroundDrawable).backgroundColor = background.color.android; + backgroundDrawable.mutate(); backgroundDrawable.setColorFilter(backgroundColor, android.graphics.PorterDuff.Mode.SRC_IN); + backgroundDrawable.invalidateSelf(); // Make sure the drawable is invalidated. Android forgets to invalidate it in some cases: toolbar (backgroundDrawable).backgroundColor = backgroundColor; } else if (!background.isEmpty()) {