From c9744b74740be5e8062bf98023d9dfaab2adb412 Mon Sep 17 00:00:00 2001 From: vakrilov Date: Mon, 19 Oct 2015 17:29:51 +0300 Subject: [PATCH] Don't apply default values on syncNative --- ui/core/view.android.ts | 4 ++++ ui/styling/style.ts | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/core/view.android.ts b/ui/core/view.android.ts index 951226122..cd9843eeb 100644 --- a/ui/core/view.android.ts +++ b/ui/core/view.android.ts @@ -249,6 +249,10 @@ export class View extends viewCommon.View { trace.write("calling _onContextChanged on view " + this._domId, trace.categories.VisualTreeEvents); this._createUI(); + // Ensure layout params + if (this._nativeView && !(this._nativeView.getLayoutParams() instanceof org.nativescript.widgets.CommonLayoutParams)) { + this._nativeView.setLayoutParams(new org.nativescript.widgets.CommonLayoutParams()); + } utils.copyFrom(this._options, this); delete this._options; diff --git a/ui/styling/style.ts b/ui/styling/style.ts index ceaf34822..096d28905 100644 --- a/ui/styling/style.ts +++ b/ui/styling/style.ts @@ -593,7 +593,8 @@ export class Style extends DependencyObservable implements styling.Style { // TODO: Potential performance bottle-neck styleProperty.eachProperty(function (p: styleProperty.Property) { var value = that._getValue(p); - if (types.isDefined(value)) { + var valueSource = that._getValueSource(p); + if (valueSource !== ValueSource.Default && types.isDefined(value)) { that._applyProperty(p, value); } });