mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(a11y): add missing application event for fontScaleChanged (#9396)
This commit is contained in:
@@ -11,6 +11,7 @@ function fontScaleChanged(origFontScale: number) {
|
|||||||
Application.notify({
|
Application.notify({
|
||||||
eventName: Application.fontScaleChangedEvent,
|
eventName: Application.fontScaleChangedEvent,
|
||||||
object: Application,
|
object: Application,
|
||||||
|
newValue: currentFontScale,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ function fontScaleChanged(origFontScale: number) {
|
|||||||
Application.notify({
|
Application.notify({
|
||||||
eventName: Application.fontScaleChangedEvent,
|
eventName: Application.fontScaleChangedEvent,
|
||||||
object: Application,
|
object: Application,
|
||||||
|
newValue: currentFontScale,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
12
packages/core/application/index.d.ts
vendored
12
packages/core/application/index.d.ts
vendored
@@ -135,6 +135,16 @@ export interface SystemAppearanceChangedEventData extends ApplicationEventData {
|
|||||||
newValue: 'light' | 'dark';
|
newValue: 'light' | 'dark';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Event data containing information for font scale changed event.
|
||||||
|
*/
|
||||||
|
export interface FontScaleChangedEventData extends ApplicationEventData {
|
||||||
|
/**
|
||||||
|
* New font scale value.
|
||||||
|
*/
|
||||||
|
newValue: number;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event data containing information about unhandled application errors.
|
* Event data containing information about unhandled application errors.
|
||||||
*/
|
*/
|
||||||
@@ -328,6 +338,8 @@ export function on(event: 'orientationChanged', callback: (args: OrientationChan
|
|||||||
*/
|
*/
|
||||||
export function on(event: 'systemAppearanceChanged', callback: (args: SystemAppearanceChangedEventData) => void, thisArg?: any);
|
export function on(event: 'systemAppearanceChanged', callback: (args: SystemAppearanceChangedEventData) => void, thisArg?: any);
|
||||||
|
|
||||||
|
export function on(event: 'fontScaleChanged', callback: (args: FontScaleChangedEventData) => void, thisArg?: any);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the orientation of the application.
|
* Gets the orientation of the application.
|
||||||
* Available values: "portrait", "landscape", "unknown".
|
* Available values: "portrait", "landscape", "unknown".
|
||||||
|
|||||||
1
packages/core/index.d.ts
vendored
1
packages/core/index.d.ts
vendored
@@ -20,6 +20,7 @@ export declare const Application: {
|
|||||||
lowMemoryEvent: string;
|
lowMemoryEvent: string;
|
||||||
orientationChangedEvent: string;
|
orientationChangedEvent: string;
|
||||||
systemAppearanceChangedEvent: string;
|
systemAppearanceChangedEvent: string;
|
||||||
|
fontScaleChangedEvent: string;
|
||||||
systemAppearanceChanged: typeof systemAppearanceChanged;
|
systemAppearanceChanged: typeof systemAppearanceChanged;
|
||||||
getMainEntry: typeof getMainEntry;
|
getMainEntry: typeof getMainEntry;
|
||||||
getRootView: typeof getRootView;
|
getRootView: typeof getRootView;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import './globals';
|
|||||||
export { iOSApplication, AndroidApplication } from './application';
|
export { iOSApplication, AndroidApplication } from './application';
|
||||||
export type { ApplicationEventData, LaunchEventData, OrientationChangedEventData, UnhandledErrorEventData, DiscardedErrorEventData, CssChangedEventData, LoadAppCSSEventData, AndroidActivityEventData, AndroidActivityBundleEventData, AndroidActivityRequestPermissionsEventData, AndroidActivityResultEventData, AndroidActivityNewIntentEventData, AndroidActivityBackPressedEventData, SystemAppearanceChangedEventData } from './application';
|
export type { ApplicationEventData, LaunchEventData, OrientationChangedEventData, UnhandledErrorEventData, DiscardedErrorEventData, CssChangedEventData, LoadAppCSSEventData, AndroidActivityEventData, AndroidActivityBundleEventData, AndroidActivityRequestPermissionsEventData, AndroidActivityResultEventData, AndroidActivityNewIntentEventData, AndroidActivityBackPressedEventData, SystemAppearanceChangedEventData } from './application';
|
||||||
|
|
||||||
import { launchEvent, displayedEvent, uncaughtErrorEvent, discardedErrorEvent, suspendEvent, resumeEvent, exitEvent, lowMemoryEvent, orientationChangedEvent, systemAppearanceChanged, systemAppearanceChangedEvent, getMainEntry, getRootView, _resetRootView, getResources, setResources, setCssFileName, getCssFileName, loadAppCss, addCss, on, off, notify, hasListeners, run, orientation, getNativeApplication, hasLaunched, android as appAndroid, ios as iosApp, systemAppearance } from './application';
|
import { fontScaleChangedEvent, launchEvent, displayedEvent, uncaughtErrorEvent, discardedErrorEvent, suspendEvent, resumeEvent, exitEvent, lowMemoryEvent, orientationChangedEvent, systemAppearanceChanged, systemAppearanceChangedEvent, getMainEntry, getRootView, _resetRootView, getResources, setResources, setCssFileName, getCssFileName, loadAppCss, addCss, on, off, notify, hasListeners, run, orientation, getNativeApplication, hasLaunched, android as appAndroid, ios as iosApp, systemAppearance } from './application';
|
||||||
export const Application = {
|
export const Application = {
|
||||||
launchEvent,
|
launchEvent,
|
||||||
displayedEvent,
|
displayedEvent,
|
||||||
@@ -18,6 +18,7 @@ export const Application = {
|
|||||||
orientationChangedEvent,
|
orientationChangedEvent,
|
||||||
systemAppearanceChangedEvent,
|
systemAppearanceChangedEvent,
|
||||||
systemAppearanceChanged,
|
systemAppearanceChanged,
|
||||||
|
fontScaleChangedEvent,
|
||||||
|
|
||||||
getMainEntry,
|
getMainEntry,
|
||||||
getRootView,
|
getRootView,
|
||||||
|
|||||||
Reference in New Issue
Block a user