File tree Expand file tree Collapse file tree 5 files changed +18
-1
lines changed Expand file tree Collapse file tree 5 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -189,6 +189,10 @@ export class ActionBar extends ActionBarBase {
189
189
this . update ( ) ;
190
190
}
191
191
192
+ override get needsNativeDrawableFill ( ) : boolean {
193
+ return true ;
194
+ }
195
+
192
196
public update ( ) {
193
197
if ( ! this . nativeViewProtected ) {
194
198
return ;
Original file line number Diff line number Diff line change @@ -106,6 +106,10 @@ export class Button extends ButtonBase {
106
106
}
107
107
}
108
108
109
+ override get needsNativeDrawableFill ( ) : boolean {
110
+ return true ;
111
+ }
112
+
109
113
[ minWidthProperty . getDefault ] ( ) : CoreTypes . LengthType {
110
114
const dips = org . nativescript . widgets . ViewHelper . getMinWidth ( this . nativeViewProtected ) ;
111
115
Original file line number Diff line number Diff line change @@ -1134,7 +1134,8 @@ export class View extends ViewCommon {
1134
1134
nativeView . setBackground ( backgroundDrawable ) ;
1135
1135
}
1136
1136
1137
- if ( backgroundDrawable ) {
1137
+ // Apply color to drawables when there is the need to maintain visual things like button ripple effect
1138
+ if ( this . needsNativeDrawableFill && backgroundDrawable ) {
1138
1139
backgroundDrawable . mutate ( ) ;
1139
1140
1140
1141
AndroidHelper . setDrawableColor ( backgroundColor , backgroundDrawable ) ;
Original file line number Diff line number Diff line change @@ -781,6 +781,10 @@ export abstract class View extends ViewCommon {
781
781
* @private
782
782
*/
783
783
isLayoutRequired : boolean ;
784
+ /**
785
+ * @private
786
+ */
787
+ get needsNativeDrawableFill ( ) : boolean ;
784
788
/**
785
789
* @private
786
790
*/
Original file line number Diff line number Diff line change @@ -984,6 +984,10 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition {
984
984
return true ;
985
985
}
986
986
987
+ get needsNativeDrawableFill ( ) : boolean {
988
+ return false ;
989
+ }
990
+
987
991
public measure ( widthMeasureSpec : number , heightMeasureSpec : number ) : void {
988
992
this . _setCurrentMeasureSpecs ( widthMeasureSpec , heightMeasureSpec ) ;
989
993
}
You can’t perform that action at this time.
0 commit comments