@@ -12,6 +12,7 @@ import imageSource = require("image-source");
12
12
import utils = require( "utils/utils" ) ;
13
13
import font = require( "ui/styling/font" ) ;
14
14
import background = require( "ui/styling/background" ) ;
15
+ import platform = require( "platform" ) ;
15
16
16
17
// key is the property id and value is Dictionary<string, StylePropertyChangedHandler>;
17
18
var _registeredHandlers = Array < Object > ( ) ;
@@ -23,7 +24,7 @@ var _handlersCache = {};
23
24
var noStylingClasses = { } ;
24
25
25
26
// on Android we explicitly set propertySettings to None because android will invalidate its layout (skip unnecessary native call).
26
- var AffectsLayout = global . android ? PropertyMetadataSettings . None : PropertyMetadataSettings . AffectsLayout ;
27
+ var AffectsLayout = platform . device . os === platform . platformNames . android ? PropertyMetadataSettings . None : PropertyMetadataSettings . AffectsLayout ;
27
28
28
29
export interface Thickness {
29
30
left : number ;
@@ -850,7 +851,7 @@ export var nativePaddingsProperty = new styleProperty.Property("paddingNative",
850
851
new PropertyMetadata ( undefined , null , null , null , thicknessComparer ) ) ;
851
852
852
853
// TODO: separate into .android/.ios files so that there is no need for such checks
853
- var defaultPadding = global . android ? undefined : 0 ;
854
+ var defaultPadding = platform . device . os === platform . platformNames . android ? undefined : 0 ;
854
855
855
856
export var paddingLeftProperty = new styleProperty . Property ( "paddingLeft" , "padding-left" ,
856
857
new PropertyMetadata ( defaultPadding , AffectsLayout , onPaddingValueChanged , isPaddingValid ) , converters . numberConverter ) ;
@@ -865,7 +866,7 @@ export var paddingBottomProperty = new styleProperty.Property("paddingBottom", "
865
866
new PropertyMetadata ( defaultPadding , AffectsLayout , onPaddingValueChanged , isPaddingValid ) , converters . numberConverter ) ;
866
867
867
868
// TODO: separate into .android/.ios files so that there is no need for such checks
868
- if ( global . android ) {
869
+ if ( platform . device . os === platform . platformNames . android ) {
869
870
paddingTopProperty . defaultValueGetter = getNativePaddingTop ;
870
871
paddingLeftProperty . defaultValueGetter = getNativePaddingLeft ;
871
872
paddingRightProperty . defaultValueGetter = getNativePaddingRight ;
0 commit comments