mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-14 10:01:08 +08:00
fix(application): restore AndroidApplication.on etc. (#10336)
This commit is contained in:
@ -126,6 +126,28 @@ export class ApplicationCommon {
|
||||
readonly loadAppCssEvent = 'loadAppCss';
|
||||
readonly cssChangedEvent = 'cssChanged';
|
||||
|
||||
// Expose statically for backwards compat on AndroidApplication.on etc.
|
||||
/**
|
||||
* @deprecated Use `Application.android.on()` instead.
|
||||
*/
|
||||
static on: ApplicationEvents['on'] = globalEvents.on.bind(globalEvents);
|
||||
/**
|
||||
* @deprecated Use `Application.android.once()` instead.
|
||||
*/
|
||||
static once: ApplicationEvents['on'] = globalEvents.once.bind(globalEvents);
|
||||
/**
|
||||
* @deprecated Use `Application.android.off()` instead.
|
||||
*/
|
||||
static off: ApplicationEvents['off'] = globalEvents.off.bind(globalEvents);
|
||||
/**
|
||||
* @deprecated Use `Application.android.notify()` instead.
|
||||
*/
|
||||
static notify: ApplicationEvents['notify'] = globalEvents.notify.bind(globalEvents);
|
||||
/**
|
||||
* @deprecated Use `Application.android.hasListeners()` instead.
|
||||
*/
|
||||
static hasListeners: ApplicationEvents['hasListeners'] = globalEvents.hasListeners.bind(globalEvents);
|
||||
|
||||
// Application events go through the global events.
|
||||
on: ApplicationEvents['on'] = globalEvents.on.bind(globalEvents);
|
||||
once: ApplicationEvents['on'] = globalEvents.once.bind(globalEvents);
|
||||
|
Reference in New Issue
Block a user