feat(ios): new a11y properties for managing font scale (#10260)

This commit is contained in:
Dimitris-Rafail Katsampas
2023-04-06 02:20:15 +03:00
committed by GitHub
parent 2f9e5c0b84
commit 7aaa1d899d
11 changed files with 196 additions and 34 deletions

View File

@@ -2,8 +2,8 @@ import { TransformFunctionsInfo } from '../animation';
import { CoreTypes } from '../../core-types';
import { Color } from '../../color';
import { CssProperty, CssAnimationProperty, ShorthandProperty, InheritedCssProperty } from '../core/properties';
import { Style } from '../styling/style';
import { Font, FontStyle, FontWeight } from './font';
import { Style } from './style';
import { Font, FontStyleType, FontWeightType } from './font';
import { Background } from './background';
export namespace Length {
@@ -95,11 +95,12 @@ export const verticalAlignmentProperty: CssProperty<Style, CoreTypes.VerticalAli
export const fontSizeProperty: InheritedCssProperty<Style, number>;
export const fontFamilyProperty: InheritedCssProperty<Style, string>;
export const fontStyleProperty: InheritedCssProperty<Style, FontStyle>;
export const fontWeightProperty: InheritedCssProperty<Style, FontWeight>;
export const fontStyleProperty: InheritedCssProperty<Style, FontStyleType>;
export const fontWeightProperty: InheritedCssProperty<Style, FontWeightType>;
export const backgroundInternalProperty: CssProperty<Style, Background>;
export const fontInternalProperty: InheritedCssProperty<Style, Font>;
export const fontScaleInternalProperty: InheritedCssProperty<Style, number>;
export const androidElevationProperty: CssProperty<Style, number>;
export const androidDynamicElevationOffsetProperty: CssProperty<Style, number>;

View File

@@ -1,12 +1,12 @@
// Types
import { unsetValue, CssProperty, CssAnimationProperty, ShorthandProperty, InheritedCssProperty } from '../core/properties';
import { Style } from '../styling/style';
import { Style } from './style';
import { Transformation, TransformationValue, TransformFunctionsInfo } from '../animation';
import { Color } from '../../color';
import { Font, parseFont, FontStyle, FontStyleType, FontWeight, FontWeightType, FontVariationSettings, FontVariationSettingsType } from '../../ui/styling/font';
import { Font, parseFont, FontStyle, FontStyleType, FontWeight, FontWeightType, FontVariationSettings, FontVariationSettingsType } from './font';
import { Background } from './background';
import { layout, hasDuplicates } from '../../utils';
import { Background } from '../../ui/styling/background';
import { radiansToDegrees } from '../../utils/number-utils';
@@ -1326,13 +1326,13 @@ export const fontFamilyProperty = new InheritedCssProperty<Style, string>({
});
fontFamilyProperty.register(Style);
export const fontScaleProperty = new InheritedCssProperty<Style, number>({
name: '_fontScale',
cssName: '_fontScale',
export const fontScaleInternalProperty = new InheritedCssProperty<Style, number>({
name: 'fontScaleInternal',
cssName: '_fontScaleInternal',
defaultValue: 1.0,
valueConverter: (v) => parseFloat(v),
});
fontScaleProperty.register(Style);
fontScaleInternalProperty.register(Style);
export const fontSizeProperty = new InheritedCssProperty<Style, number>({
name: 'fontSize',

View File

@@ -108,7 +108,7 @@ export class Style extends Observable implements StyleDefinition {
/**
* This property ensures inheritance of a11y scale among views.
*/
public _fontScale: number;
public fontScaleInternal: number;
public backgroundInternal: Background;
public rotate: number;
@@ -233,6 +233,9 @@ export class Style extends Observable implements StyleDefinition {
public accessibilityLanguage: string;
public accessibilityMediaSession: boolean;
public accessibilityStep: number;
public iosAccessibilityAdjustsFontSize: boolean;
public iosAccessibilityMinFontScale: number;
public iosAccessibilityMaxFontScale: number;
public PropertyBag: {
new (): { [property: string]: string };