mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
feat(ios): new a11y properties for managing font scale (#10260)
This commit is contained in:
committed by
GitHub
parent
2f9e5c0b84
commit
7aaa1d899d
@@ -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>;
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user