@@ -12,6 +12,7 @@ import imageSource = require("image-source");
1212import utils = require( "utils/utils" ) ;
1313import font = require( "ui/styling/font" ) ;
1414import background = require( "ui/styling/background" ) ;
15+ import platform = require( "platform" ) ;
1516
1617// key is the property id and value is Dictionary<string, StylePropertyChangedHandler>;
1718var _registeredHandlers = Array < Object > ( ) ;
@@ -23,7 +24,7 @@ var _handlersCache = {};
2324var noStylingClasses = { } ;
2425
2526// 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 ;
2728
2829export interface Thickness {
2930 left : number ;
@@ -850,7 +851,7 @@ export var nativePaddingsProperty = new styleProperty.Property("paddingNative",
850851 new PropertyMetadata ( undefined , null , null , null , thicknessComparer ) ) ;
851852
852853// 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 ;
854855
855856export var paddingLeftProperty = new styleProperty . Property ( "paddingLeft" , "padding-left" ,
856857 new PropertyMetadata ( defaultPadding , AffectsLayout , onPaddingValueChanged , isPaddingValid ) , converters . numberConverter ) ;
@@ -865,7 +866,7 @@ export var paddingBottomProperty = new styleProperty.Property("paddingBottom", "
865866 new PropertyMetadata ( defaultPadding , AffectsLayout , onPaddingValueChanged , isPaddingValid ) , converters . numberConverter ) ;
866867
867868// 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 ) {
869870 paddingTopProperty . defaultValueGetter = getNativePaddingTop ;
870871 paddingLeftProperty . defaultValueGetter = getNativePaddingLeft ;
871872 paddingRightProperty . defaultValueGetter = getNativePaddingRight ;
0 commit comments