@@ -54,6 +54,7 @@ const formattedTextProperty = new Property<Label, FormattedString>({
5454 valueChanged : onFormattedTextPropertyChanged
5555} ) ;
5656export const htmlProperty = new Property < Label , string > ( { name : 'html' , defaultValue : null , affectsLayout : true } ) ;
57+ export const androidA11yAdjustsFontSizeProperty = new Property < Label , boolean > ( { name : 'androidA11yAdjustsFontSize' , defaultValue : false } ) ;
5758
5859@CSSType ( 'HTMLLabel' )
5960abstract class LabelBase extends View implements LabelViewDefinition {
@@ -68,6 +69,7 @@ abstract class LabelBase extends View implements LabelViewDefinition {
6869 @cssProperty textShadow : ShadowCSSValues ;
6970 @cssProperty linkUnderline : boolean ;
7071 public html : string ;
72+ public androidA11yAdjustsFontSize : boolean ;
7173 @cssProperty selectable : boolean ;
7274
7375 public mIsSingleLine : boolean ;
@@ -269,7 +271,13 @@ export class Label extends LabelBase {
269271 }
270272 }
271273 [ fontSizeProperty . setNative ] ( value : number | { nativeSize : number } ) {
272- this . nativeTextViewProtected . setLabelTextSize ( 2 , typeof value === 'number' ? value : value . nativeSize , this . minFontSize || 10 , this . maxFontSize || 200 , this . autoFontSizeStep || 1 ) ;
274+ this . nativeTextViewProtected . setLabelTextSize (
275+ this . androidA11yAdjustsFontSize ? 2 /* COMPLEX_UNIT_SP */ : 1 /* COMPLEX_UNIT_DIP */ ,
276+ typeof value === 'number' ? value : value . nativeSize ,
277+ this . minFontSize || 10 ,
278+ this . maxFontSize || 200 ,
279+ this . autoFontSizeStep || 1
280+ ) ;
273281 }
274282
275283 [ lineHeightProperty . setNative ] ( value : number ) {
@@ -453,6 +461,7 @@ export class Label extends LabelBase {
453461
454462textProperty . register ( Label ) ;
455463htmlProperty . register ( Label ) ;
464+ androidA11yAdjustsFontSizeProperty . register ( Label ) ;
456465formattedTextProperty . register ( Label ) ;
457466
458467function onFormattedTextPropertyChanged ( textBase : Label , oldValue : FormattedString , newValue : FormattedString ) {
0 commit comments