diff --git a/tns-core-modules/ui/core/view/view.android.ts b/tns-core-modules/ui/core/view/view.android.ts index 22f847d59..31eb747d8 100644 --- a/tns-core-modules/ui/core/view/view.android.ts +++ b/tns-core-modules/ui/core/view/view.android.ts @@ -785,7 +785,7 @@ export class View extends ViewCommon { androidBackground.onBackgroundOrBorderPropertyChanged(this); } else { const nativeView = this.nativeViewProtected; - org.nativescript.widgets.ViewHelper.setBackground(nativeView, value); + nativeView.setBackground(value); const style = this.style; const paddingTop = paddingTopProperty.isSet(style) ? this.effectivePaddingTop : this._defaultPaddingTop; diff --git a/tns-core-modules/ui/search-bar/search-bar.android.ts b/tns-core-modules/ui/search-bar/search-bar.android.ts index 9b7982b6f..01d2764fe 100644 --- a/tns-core-modules/ui/search-bar/search-bar.android.ts +++ b/tns-core-modules/ui/search-bar/search-bar.android.ts @@ -205,7 +205,7 @@ export class SearchBar extends SearchBarBase { if (value instanceof Color) { textView.setBackgroundColor(value.android); } else { - org.nativescript.widgets.ViewHelper.setBackground(textView, value); + textView.setBackground(value); } } [textFieldHintColorProperty.getDefault](): number { diff --git a/tns-core-modules/ui/segmented-bar/segmented-bar.android.ts b/tns-core-modules/ui/segmented-bar/segmented-bar.android.ts index c0c9ac774..bef19e7b6 100644 --- a/tns-core-modules/ui/segmented-bar/segmented-bar.android.ts +++ b/tns-core-modules/ui/segmented-bar/segmented-bar.android.ts @@ -157,7 +157,7 @@ export class SegmentedBarItem extends SegmentedBarItemBase { if (apiLevel > 21 && backgroundDrawable) { const newDrawable = tryCloneDrawable(backgroundDrawable, nativeView.getResources()); newDrawable.setColorFilter(color, android.graphics.PorterDuff.Mode.SRC_IN); - org.nativescript.widgets.ViewHelper.setBackground(viewGroup, newDrawable); + viewGroup.setBackground(newDrawable); } else { const stateDrawable = new android.graphics.drawable.StateListDrawable(); const colorDrawable: android.graphics.drawable.ColorDrawable = new org.nativescript.widgets.SegmentedBarColorDrawable(color, selectedIndicatorThickness); @@ -165,11 +165,11 @@ export class SegmentedBarItem extends SegmentedBarItemBase { arr[0] = R_ATTR_STATE_SELECTED; stateDrawable.addState(arr, colorDrawable); stateDrawable.setBounds(0, 15, viewGroup.getRight(), viewGroup.getBottom()); - org.nativescript.widgets.ViewHelper.setBackground(viewGroup, stateDrawable); + viewGroup.setBackground(stateDrawable); } } else { const backgroundDrawable = tryCloneDrawable(value, nativeView.getResources()); - org.nativescript.widgets.ViewHelper.setBackground(viewGroup, backgroundDrawable); + viewGroup.setBackground(backgroundDrawable); } } } diff --git a/tns-core-modules/ui/styling/background.android.ts b/tns-core-modules/ui/styling/background.android.ts index 1aaf2f97f..9f3e9ed77 100644 --- a/tns-core-modules/ui/styling/background.android.ts +++ b/tns-core-modules/ui/styling/background.android.ts @@ -65,7 +65,7 @@ export module ad { if (!(drawable instanceof org.nativescript.widgets.BorderDrawable)) { backgroundDrawable = new org.nativescript.widgets.BorderDrawable(layout.getDisplayDensity(), view.toString()); refreshBorderDrawable(view, backgroundDrawable); - org.nativescript.widgets.ViewHelper.setBackground(nativeView, backgroundDrawable); + nativeView.setBackground(backgroundDrawable); } else { refreshBorderDrawable(view, backgroundDrawable); } @@ -80,7 +80,7 @@ export module ad { defaultDrawable = null; } - org.nativescript.widgets.ViewHelper.setBackground(nativeView, defaultDrawable); + nativeView.setBackground(defaultDrawable); // TODO: Do we need to clear the drawable here? Can't we just reuse it again? androidView._cachedDrawable = undefined; }