mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
android LayoutParams are not overridden (#2383)
* LayoutParams are no longer overriden with CommonLayoutParams * Small code refactoring to get intellisense
This commit is contained in:
committed by
Hristo Hristov
parent
cdee27f130
commit
f201465fb3
@@ -10,13 +10,11 @@ function setNativeProperty(data: PropertyChangeData, setter: (lp: org.nativescri
|
||||
var view = data.object;
|
||||
if (view instanceof View) {
|
||||
var nativeView: android.view.View = view._nativeView;
|
||||
|
||||
var lp = <org.nativescript.widgets.CommonLayoutParams>nativeView.getLayoutParams();
|
||||
if (!(lp instanceof org.nativescript.widgets.CommonLayoutParams)) {
|
||||
lp = new org.nativescript.widgets.CommonLayoutParams();
|
||||
var lp = nativeView.getLayoutParams() || new org.nativescript.widgets.CommonLayoutParams();
|
||||
if (lp instanceof org.nativescript.widgets.CommonLayoutParams) {
|
||||
setter(lp);
|
||||
nativeView.setLayoutParams(lp);
|
||||
}
|
||||
setter(lp);
|
||||
nativeView.setLayoutParams(lp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user