File tree Expand file tree Collapse file tree
tns-core-modules/ui/styling Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ export module ad {
4040 }
4141
4242 const background = view . style . backgroundInternal ;
43- const drawable = nativeView . getBackground ( ) ;
43+ let drawable = nativeView . getBackground ( ) ;
4444 const androidView = < any > view as AndroidView ;
4545 // use undefined as not set. getBackground will never return undefined only Drawable or null;
4646 if ( androidView . _cachedDrawable === undefined && drawable ) {
@@ -50,12 +50,21 @@ export module ad {
5050
5151 if ( isSetColorFilterOnlyWidget ( nativeView )
5252 && drawable
53- && ! ( drawable instanceof org . nativescript . widgets . BorderDrawable )
5453 && ! background . hasBorderWidth ( )
5554 && ! background . hasBorderRadius ( )
5655 && ! background . clipPath
5756 && ! background . image
5857 && background . color ) {
58+
59+ if ( drawable instanceof org . nativescript . widgets . BorderDrawable ) {
60+ if ( ! ( androidView . _cachedDrawable instanceof android . graphics . drawable . Drawable . ConstantState ) ) {
61+ return ;
62+ }
63+
64+ drawable = androidView . _cachedDrawable . newDrawable ( nativeView . getResources ( ) ) ;
65+ nativeView . setBackground ( drawable ) ;
66+ }
67+
5968 const backgroundColor = ( < any > drawable ) . backgroundColor = background . color . android ;
6069 drawable . mutate ( ) ;
6170 drawable . setColorFilter ( backgroundColor , android . graphics . PorterDuff . Mode . SRC_IN ) ;
You can’t perform that action at this time.
0 commit comments