File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
packages/core/ui/layouts/flexbox-layout Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,16 @@ export * from './flexbox-layout-common';
7
7
let widgetFlexboxLayout : typeof org . nativescript . widgets . FlexboxLayout ;
8
8
let widgetLayoutParams : typeof org . nativescript . widgets . FlexboxLayout . LayoutParams ;
9
9
10
+ function ensureNativeTypes ( ) {
11
+ if ( ! widgetFlexboxLayout ) {
12
+ widgetFlexboxLayout = org . nativescript . widgets . FlexboxLayout ;
13
+ widgetLayoutParams = widgetFlexboxLayout . LayoutParams ;
14
+ }
15
+ }
16
+
10
17
function makeNativeSetter < T > ( setter : ( lp : org . nativescript . widgets . FlexboxLayout . LayoutParams , value : T ) => void ) {
11
18
return function ( this : View , value : T ) {
19
+ ensureNativeTypes ( ) ;
12
20
const nativeView : android . view . View = this . nativeViewProtected ;
13
21
const lp = nativeView . getLayoutParams ( ) || new widgetLayoutParams ( ) ;
14
22
if ( lp instanceof widgetLayoutParams ) {
@@ -76,10 +84,7 @@ export class FlexboxLayout extends FlexboxLayoutBase {
76
84
77
85
constructor ( ) {
78
86
super ( ) ;
79
- if ( ! widgetFlexboxLayout ) {
80
- widgetFlexboxLayout = org . nativescript . widgets . FlexboxLayout ;
81
- widgetLayoutParams = widgetFlexboxLayout . LayoutParams ;
82
- }
87
+ ensureNativeTypes ( ) ;
83
88
}
84
89
85
90
public createNativeView ( ) {
You can’t perform that action at this time.
0 commit comments