@akylas/nativescript 9.1.4 → 9.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/application/application-common.d.ts +9 -3
- package/application/application-common.js +16 -3
- package/application/application-common.js.map +1 -1
- package/application/application.android.js +2 -6
- package/application/application.android.js.map +1 -1
- package/application/application.ios.js +8 -12
- package/application/application.ios.js.map +1 -1
- package/application/helpers-common.d.ts +2 -0
- package/application/helpers-common.js +23 -0
- package/application/helpers-common.js.map +1 -1
- package/config/config.interface.d.ts +1 -1
- package/config/config.interface.js.map +1 -1
- package/css-mediaquery/index.d.ts +6 -1
- package/css-mediaquery/index.js +31 -2
- package/css-mediaquery/index.js.map +1 -1
- package/debugger/webinspector-network.d.ts +29 -0
- package/fetch/index.d.ts +79 -0
- package/fetch/index.js +408 -0
- package/fetch/index.js.map +1 -0
- package/file-system/file-system-access.android.d.ts +1 -0
- package/file-system/file-system-access.android.js +18 -21
- package/file-system/file-system-access.android.js.map +1 -1
- package/global-types.d.ts +1 -1
- package/globals/index.js +4 -4
- package/globals/index.js.map +1 -1
- package/http/http-request/index.android.js +5 -1
- package/http/http-request/index.android.js.map +1 -1
- package/http/http-request-internal/http-request-internal-common.d.ts +1 -0
- package/http/http-request-internal/http-request-internal-common.js +9 -0
- package/http/http-request-internal/http-request-internal-common.js.map +1 -1
- package/http/http-request-internal/index.android.js +7 -5
- package/http/http-request-internal/index.android.js.map +1 -1
- package/http/http-request-internal/index.ios.js +33 -16
- package/http/http-request-internal/index.ios.js.map +1 -1
- package/image-source/index.ios.js +7 -6
- package/image-source/index.ios.js.map +1 -1
- package/index.d.ts +1 -1
- package/js-libs/easysax/easysax.d.ts +49 -7
- package/js-libs/easysax/easysax.js +631 -747
- package/js-libs/easysax/easysax.js.map +1 -0
- package/media-query-list/index.js +57 -15
- package/media-query-list/index.js.map +1 -1
- package/module-name-resolver/helpers.d.ts +1 -1
- package/module-name-resolver/helpers.js.map +1 -1
- package/module-name-resolver/index.d.ts +2 -2
- package/module-name-resolver/index.js.map +1 -1
- package/native-window/native-window.ios.js +3 -5
- package/native-window/native-window.ios.js.map +1 -1
- package/package.json +2 -3
- package/timer/index.android.js +2 -1
- package/timer/index.android.js.map +1 -1
- package/ui/action-bar/index.android.js +5 -4
- package/ui/action-bar/index.android.js.map +1 -1
- package/ui/animation/index.ios.js +6 -1
- package/ui/animation/index.ios.js.map +1 -1
- package/ui/builder/binding-builder.d.ts +8 -0
- package/ui/builder/binding-builder.js +12 -0
- package/ui/builder/binding-builder.js.map +1 -1
- package/ui/builder/component-builder/index.d.ts +7 -4
- package/ui/builder/component-builder/index.js +13 -7
- package/ui/builder/component-builder/index.js.map +1 -1
- package/ui/builder/index.d.ts +16 -2
- package/ui/builder/index.js +52 -12
- package/ui/builder/index.js.map +1 -1
- package/ui/button/index.android.js +4 -3
- package/ui/button/index.android.js.map +1 -1
- package/ui/content-view/index.js +2 -0
- package/ui/content-view/index.js.map +1 -1
- package/ui/core/bindable/bindable-types.d.ts +15 -0
- package/ui/core/bindable/bindable-types.js.map +1 -1
- package/ui/core/bindable/index.d.ts +1 -1
- package/ui/core/bindable/index.js +12 -7
- package/ui/core/bindable/index.js.map +1 -1
- package/ui/core/view/index.android.js +11 -9
- package/ui/core/view/index.android.js.map +1 -1
- package/ui/date-picker/index.android.js +1 -1
- package/ui/date-picker/index.android.js.map +1 -1
- package/ui/editable-text-base/index.android.d.ts +2 -0
- package/ui/editable-text-base/index.android.js +15 -6
- package/ui/editable-text-base/index.android.js.map +1 -1
- package/ui/editable-text-base/index.d.ts +8 -0
- package/ui/frame/fragment.transitions.android.d.ts +8 -5
- package/ui/frame/fragment.transitions.android.js +16 -18
- package/ui/frame/fragment.transitions.android.js.map +1 -1
- package/ui/frame/index.android.d.ts +1 -0
- package/ui/frame/index.android.js +10 -4
- package/ui/frame/index.android.js.map +1 -1
- package/ui/gestures/index.android.js +18 -9
- package/ui/gestures/index.android.js.map +1 -1
- package/ui/gestures/index.ios.js +6 -6
- package/ui/gestures/index.ios.js.map +1 -1
- package/ui/image/index.android.js +1 -1
- package/ui/image/index.android.js.map +1 -1
- package/ui/image-cache/index.android.js +1 -2
- package/ui/image-cache/index.android.js.map +1 -1
- package/ui/index.d.ts +1 -1
- package/ui/index.js.map +1 -1
- package/ui/list-picker/index.android.d.ts +1 -0
- package/ui/list-picker/index.android.js +6 -5
- package/ui/list-picker/index.android.js.map +1 -1
- package/ui/list-view/index.android.js +17 -9
- package/ui/list-view/index.android.js.map +1 -1
- package/ui/page/index.ios.js +7 -3
- package/ui/page/index.ios.js.map +1 -1
- package/ui/search-bar/index.android.js +2 -2
- package/ui/search-bar/index.android.js.map +1 -1
- package/ui/segmented-bar/index.android.js +8 -8
- package/ui/segmented-bar/index.android.js.map +1 -1
- package/ui/slider/index.android.js +1 -2
- package/ui/slider/index.android.js.map +1 -1
- package/ui/styling/background-common.js +2 -2
- package/ui/styling/background-common.js.map +1 -1
- package/ui/styling/background.d.ts +1 -1
- package/ui/styling/background.ios.d.ts +1 -1
- package/ui/styling/background.ios.js +1 -1
- package/ui/styling/background.ios.js.map +1 -1
- package/ui/styling/style/index.d.ts +13 -2
- package/ui/styling/style/index.js.map +1 -1
- package/ui/styling/style-scope.js +6 -0
- package/ui/styling/style-scope.js.map +1 -1
- package/ui/switch/index.android.js +1 -1
- package/ui/switch/index.android.js.map +1 -1
- package/ui/tab-view/index.android.js +9 -16
- package/ui/tab-view/index.android.js.map +1 -1
- package/ui/tab-view/index.ios.js +2 -2
- package/ui/tab-view/index.ios.js.map +1 -1
- package/ui/text-base/index.android.js +1 -1
- package/ui/text-base/index.android.js.map +1 -1
- package/ui/text-base/index.ios.js +1 -1
- package/ui/text-base/index.ios.js.map +1 -1
- package/ui/time-picker/index.android.js +1 -1
- package/ui/time-picker/index.android.js.map +1 -1
- package/ui/transition/page-transition.android.js +0 -44
- package/ui/transition/page-transition.android.js.map +1 -1
- package/ui/web-view/index.android.js +1 -1
- package/ui/web-view/index.android.js.map +1 -1
- package/utils/android-runtime-version.d.ts +12 -0
- package/utils/android-runtime-version.js +36 -0
- package/utils/android-runtime-version.js.map +1 -0
- package/utils/native-helper-for-android.js +3 -1
- package/utils/native-helper-for-android.js.map +1 -1
- package/xhr/index.d.ts +5 -4
- package/xhr/index.js +18 -18
- package/xhr/index.js.map +1 -1
- package/xml/index.d.ts +2 -2
- package/xml/index.js +1 -1
- package/xml/index.js.map +1 -1
- package/LICENSE +0 -19
- package/fetch/index.mjs +0 -535
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.android.js","sourceRoot":"","sources":["../../../../packages/core/application/application.android.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,mBAAmB,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAE7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAE/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,4BAA4B,EAAE,uBAAuB,EAAE,4BAA4B,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AACzI,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,gCAAgC,EAAE,eAAe,EAAE,YAAY,EAAE,WAAW,EAAE,0CAA0C,EAAE,MAAM,kBAAkB,CAAC;AACxN,OA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AE,EAAE,CAAC;YACvB,eAAe,EAAE,CAAC,UAAU,EAAE,CAAC;QAChC,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import * as ApplicationSettings from '../application-settings';\nimport { CoreTypes } from '../core-types';\nimport { profile } from '../profiling';\nimport type { View } from '../ui/core/view';\nimport { AndroidActivityCallbacks, NavigationEntry } from '../ui/frame/frame-common';\nimport { isEmbedded } from '../ui/embedding';\nimport { SDK_VERSION } from '../utils/constants';\nimport { dataSerialize } from '../utils';\nimport { ApplicationCommon } from './application-common';\nimport type { AndroidActivityBundleEventData, AndroidActivityEventData, AndroidConfigurationChangeEventData, ApplicationEventData } from './application-interfaces';\nimport type { AndroidApplication as IAndroidApplication } from './application';\nimport { Trace } from '../trace';\nimport { AndroidNativeWindow } from '../native-window/native-window.android';\nimport { NativeWindow } from '../native-window/native-window-common';\nimport { NativeWindowEvents } from '../native-window/native-window-interfaces';\nimport type { WindowOpenOptions } from '../native-window/native-window-interfaces';\nimport { fontScaleChanged } from '../accessibility/font-scale.android';\nimport { androidGetForegroundActivity, androidGetStartActivity, androidSetForegroundActivity, androidSetStartActivity } from './helpers';\nimport { getImageFetcher, getNativeApp, getRootView, initImageCache, setApplicationPropertiesCallback, setAppMainEntry, setNativeApp, setRootView, setToggleApplicationEventListenersCallback } from './helpers-common';\nimport { getNativeScriptGlobals } from '../globals/global-utils';\nimport lazy from '../utils/lazy';\n\ndeclare class NativeScriptLifecycleCallbacks extends android.app.Application.ActivityLifecycleCallbacks {}\n\nconst WINDOW_ID_EXTRA = 'com.tns.activity.windowId';\n\nlet multiWindowWarned = false;\n\nfunction warnMultiWindowIsExperimental(): void {\n\tif (multiWindowWarned) {\n\t\treturn;\n\t}\n\tmultiWindowWarned = true;\n\n\tconst message = 'Application.android.openWindow() is experimental. The start activity must not use launchMode=\"singleTask\" (the app template default) or \"singleInstance\" in AndroidManifest.xml, or Android hands the launch intent to the existing activity instead of opening a second one; use \"singleInstancePerTask\" (API 31+) or \"standard\".';\n\tTrace.write(message, Trace.categories.Debug, Trace.messageType.warn);\n\tconsole.warn(message);\n}\n\nlet NativeScriptLifecycleCallbacks_: typeof NativeScriptLifecycleCallbacks;\nfunction initNativeScriptLifecycleCallbacks() {\n\tif (NativeScriptLifecycleCallbacks_) {\n\t\treturn NativeScriptLifecycleCallbacks_;\n\t}\n\n\t@NativeClass\n\t@JavaProxy('org.nativescript.NativeScriptLifecycleCallbacks')\n\tclass NativeScriptLifecycleCallbacksImpl extends android.app.Application.ActivityLifecycleCallbacks {\n\t\tprivate activitiesCount: number;\n\t\tprivate nativescriptActivity: androidx.appcompat.app.AppCompatActivity;\n\n\t\t@profile\n\t\tpublic onActivityCreated(activity: androidx.appcompat.app.AppCompatActivity, savedInstanceState: android.os.Bundle): void {\n\t\t\t// console.log('NativeScriptLifecycleCallbacks onActivityCreated');\n\t\t\tthis.setThemeOnLaunch(activity);\n\n\t\t\tif (!Application.android.startActivity) {\n\t\t\t\tApplication.android.setStartActivity(activity);\n\t\t\t}\n\t\t\tif (!Application.android.foregroundActivity) {\n\t\t\t\tApplication.android.setForegroundActivity(activity);\n\t\t\t}\n\n\t\t\tif (!this.nativescriptActivity && 'isNativeScriptActivity' in activity) {\n\t\t\t\tthis.nativescriptActivity = activity;\n\t\t\t}\n\n\t\t\t// Create and register NativeWindow for this activity\n\t\t\tconst savedWindowId = savedInstanceState?.getString(WINDOW_ID_EXTRA);\n\t\t\tconst knownWindow = savedWindowId ? (Application.android.getWindowById(savedWindowId) as AndroidNativeWindow) : undefined;\n\t\t\tlet nativeWindow: AndroidNativeWindow;\n\n\t\t\tif (knownWindow?.state === 'detached') {\n\t\t\t\t// The activity was recreated (rotation, theme change): the same window\n\t\t\t\t// instance carries on, keeping its listeners and identity.\n\t\t\t\tknownWindow._reattach(activity);\n\t\t\t\tnativeWindow = knownWindow;\n\t\t\t} else {\n\t\t\t\tconst isPrimary = Application.android._getWindows().length === 0;\n\t\t\t\t// The role is fixed at creation because it is immutable, and deciding it later would\n\t\t\t\t// mean either a second window for this activity or a window with the wrong role.\n\t\t\t\tnativeWindow = new AndroidNativeWindow(activity, savedWindowId || AndroidNativeWindow.newWindowId(), isPrimary, isEmbedded() ? 'embedded' : 'application');\n\t\t\t\tApplication.android._registerWindow(nativeWindow);\n\t\t\t}\n\n\t\t\tnativeWindow._registerConfigurationCallbacks();\n\t\t\tnativeWindow._notifyEvent(NativeWindowEvents.attached);\n\n\t\t\tthis.notifyActivityCreated(activity, savedInstanceState, nativeWindow);\n\n\t\t\tif (Application.hasListeners(Application.displayedEvent)) {\n\t\t\t\tthis.subscribeForGlobalLayout(activity);\n\t\t\t}\n\t\t}\n\n\t\t@profile\n\t\tpublic onActivityDestroyed(activity: androidx.appcompat.app.AppCompatActivity): void {\n\t\t\t// console.log('NativeScriptLifecycleCallbacks onActivityDestroyed');\n\t\t\tif (activity === Application.android.foregroundActivity) {\n\t\t\t\tApplication.android.setForegroundActivity(undefined);\n\t\t\t}\n\n\t\t\tif (activity === this.nativescriptActivity) {\n\t\t\t\tthis.nativescriptActivity = undefined;\n\t\t\t}\n\n\t\t\tif (activity === Application.android.startActivity) {\n\t\t\t\tApplication.android.setStartActivity(undefined);\n\n\t\t\t\t// Fallback for start activity when it is destroyed but we have a known nativescript activity\n\t\t\t\tif (this.nativescriptActivity) {\n\t\t\t\t\tApplication.android.setStartActivity(this.nativescriptActivity);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst nativeWindow = Application.android._getWindowForActivity(activity);\n\t\t\tif (nativeWindow) {\n\t\t\t\t// Android always pauses before destroying, so the window has normally left the\n\t\t\t\t// active aggregate already; this only keeps a dropped pause from stranding it\n\t\t\t\t// there and wedging the app as never-suspended.\n\t\t\t\tApplication.android._setWindowActive(nativeWindow, false, activity);\n\n\t\t\t\tnativeWindow._surfaceGone = true;\n\n\t\t\t\t// A destroyed activity only ends the window session when it is finishing —\n\t\t\t\t// otherwise Android is recreating it and the same window is reused.\n\t\t\t\tconst isClosing = activity.isFinishing();\n\n\t\t\t\tif (isClosing) {\n\t\t\t\t\tnativeWindow._notifyEvent(NativeWindowEvents.close);\n\t\t\t\t}\n\n\t\t\t\t// Emit activityDestroyed on NativeWindow\n\t\t\t\tnativeWindow.notify({\n\t\t\t\t\teventName: NativeWindowEvents.activityDestroyed,\n\t\t\t\t\tobject: nativeWindow,\n\t\t\t\t\twindow: nativeWindow,\n\t\t\t\t\tactivity,\n\t\t\t\t} as AndroidActivityEventData);\n\n\t\t\t\tif (isClosing) {\n\t\t\t\t\tApplication.android._unregisterWindow(nativeWindow);\n\t\t\t\t} else {\n\t\t\t\t\tnativeWindow._detach();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tApplication.android.notify({\n\t\t\t\teventName: Application.android.activityDestroyedEvent,\n\t\t\t\tobject: Application.android,\n\t\t\t\twindow: nativeWindow,\n\t\t\t\tactivity,\n\t\t\t} as AndroidActivityEventData);\n\n\t\t\t// This callback runs for every activity in the process, not just NativeScript ones,\n\t\t\t// so an empty registry here means the app really has no window left.\n\t\t\tif (activity.isFinishing() && Application.android._getWindows().length === 0) {\n\t\t\t\tApplication.android.notify({\n\t\t\t\t\teventName: Application.exitEvent,\n\t\t\t\t\tobject: Application.android,\n\t\t\t\t\tandroid: activity,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// TODO: This is a temporary workaround to force the V8's Garbage Collector, which will force the related Java Object to be collected.\n\t\t\tgc();\n\t\t}\n\n\t\t@profile\n\t\tpublic onActivityPaused(activity: androidx.appcompat.app.AppCompatActivity): void {\n\t\t\t// console.log('NativeScriptLifecycleCallbacks onActivityPaused');\n\t\t\tconst nativeWindow = Application.android._getWindowForActivity(activity);\n\n\t\t\t// `onActivityCreated` registers a window for every activity in the process, so the\n\t\t\t// window's role cannot tell a NativeScript activity from a third-party one.\n\t\t\tif ('isNativeScriptActivity' in activity) {\n\t\t\t\tApplication.android._setWindowActive(nativeWindow, false, activity);\n\t\t\t}\n\n\t\t\tif (nativeWindow) {\n\t\t\t\tnativeWindow._notifyEvent(NativeWindowEvents.deactivate);\n\t\t\t\t// Emit activityPaused on NativeWindow\n\t\t\t\tnativeWindow.notify({\n\t\t\t\t\teventName: NativeWindowEvents.activityPaused,\n\t\t\t\t\tobject: nativeWindow,\n\t\t\t\t\twindow: nativeWindow,\n\t\t\t\t\tactivity,\n\t\t\t\t} as AndroidActivityEventData);\n\t\t\t}\n\n\t\t\tApplication.android.notify({\n\t\t\t\teventName: Application.android.activityPausedEvent,\n\t\t\t\tobject: Application.android,\n\t\t\t\twindow: nativeWindow,\n\t\t\t\tactivity,\n\t\t\t} as AndroidActivityEventData);\n\t\t}\n\n\t\t@profile\n\t\tpublic onActivityResumed(activity: androidx.appcompat.app.AppCompatActivity): void {\n\t\t\t// console.log('NativeScriptLifecycleCallbacks onActivityResumed');\n\t\t\tApplication.android.setForegroundActivity(activity);\n\n\t\t\tconst nativeWindow = Application.android._getWindowForActivity(activity);\n\t\t\tif (nativeWindow) {\n\t\t\t\tnativeWindow._notifyEvent(NativeWindowEvents.activate);\n\t\t\t\t// Emit activityResumed on NativeWindow\n\t\t\t\tnativeWindow.notify({\n\t\t\t\t\teventName: NativeWindowEvents.activityResumed,\n\t\t\t\t\tobject: nativeWindow,\n\t\t\t\t\twindow: nativeWindow,\n\t\t\t\t\tactivity,\n\t\t\t\t} as AndroidActivityEventData);\n\t\t\t}\n\n\t\t\t// NOTE: setSuspended(false) is called in frame/index.android.ts inside onPostResume\n\t\t\t// This is done to ensure proper timing for the event to be raised\n\n\t\t\tApplication.android.notify({\n\t\t\t\teventName: Application.android.activityResumedEvent,\n\t\t\t\tobject: Application.android,\n\t\t\t\twindow: nativeWindow,\n\t\t\t\tactivity,\n\t\t\t} as AndroidActivityEventData);\n\t\t}\n\n\t\t@profile\n\t\tpublic onActivitySaveInstanceState(activity: androidx.appcompat.app.AppCompatActivity, bundle: android.os.Bundle): void {\n\t\t\t// console.log('NativeScriptLifecycleCallbacks onActivitySaveInstanceState');\n\n\t\t\t// Emit on NativeWindow first\n\t\t\tconst nativeWindow = Application.android._getWindowForActivity(activity);\n\t\t\tif (nativeWindow) {\n\t\t\t\t// Carries the window identity across activity recreation.\n\t\t\t\tbundle.putString(WINDOW_ID_EXTRA, nativeWindow.id);\n\n\t\t\t\tnativeWindow.notify({\n\t\t\t\t\teventName: NativeWindowEvents.saveActivityState,\n\t\t\t\t\tobject: nativeWindow,\n\t\t\t\t\twindow: nativeWindow,\n\t\t\t\t\tactivity,\n\t\t\t\t\tbundle,\n\t\t\t\t} as AndroidActivityBundleEventData);\n\t\t\t}\n\n\t\t\tApplication.android.notify({\n\t\t\t\teventName: Application.android.saveActivityStateEvent,\n\t\t\t\tobject: Application.android,\n\t\t\t\twindow: nativeWindow,\n\t\t\t\tactivity,\n\t\t\t\tbundle,\n\t\t\t} as AndroidActivityBundleEventData);\n\t\t}\n\n\t\t@profile\n\t\tpublic onActivityStarted(activity: androidx.appcompat.app.AppCompatActivity): void {\n\t\t\t// console.log('NativeScriptLifecycleCallbacks onActivityStarted');\n\n\t\t\tthis.activitiesCount = (this.activitiesCount ?? 0) + 1;\n\t\t\tif (this.activitiesCount === 1) {\n\t\t\t\tApplication.android.setInBackground(false, {\n\t\t\t\t\t// todo: deprecate event.android in favor of event.activity\n\t\t\t\t\tandroid: activity,\n\t\t\t\t\tactivity,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst nativeWindow = Application.android._getWindowForActivity(activity);\n\t\t\tif (nativeWindow) {\n\t\t\t\tnativeWindow._notifyEvent(NativeWindowEvents.foreground);\n\t\t\t\t// Emit activityStarted on NativeWindow\n\t\t\t\tnativeWindow.notify({\n\t\t\t\t\teventName: NativeWindowEvents.activityStarted,\n\t\t\t\t\tobject: nativeWindow,\n\t\t\t\t\twindow: nativeWindow,\n\t\t\t\t\tactivity,\n\t\t\t\t} as AndroidActivityEventData);\n\t\t\t}\n\n\t\t\tApplication.android.notify({\n\t\t\t\teventName: Application.android.activityStartedEvent,\n\t\t\t\tobject: Application.android,\n\t\t\t\twindow: nativeWindow,\n\t\t\t\tactivity,\n\t\t\t} as AndroidActivityEventData);\n\t\t}\n\n\t\t@profile\n\t\tpublic onActivityStopped(activity: androidx.appcompat.app.AppCompatActivity): void {\n\t\t\t// console.log('NativeScriptLifecycleCallbacks onActivityStopped');\n\t\t\tthis.activitiesCount--;\n\t\t\tif (this.activitiesCount === 0) {\n\t\t\t\tApplication.android.setInBackground(true, {\n\t\t\t\t\t// todo: deprecate event.android in favor of event.activity\n\t\t\t\t\tandroid: activity,\n\t\t\t\t\tactivity,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst nativeWindow = Application.android._getWindowForActivity(activity);\n\t\t\tif (nativeWindow) {\n\t\t\t\tnativeWindow._notifyEvent(NativeWindowEvents.background);\n\t\t\t\t// Emit activityStopped on NativeWindow\n\t\t\t\tnativeWindow.notify({\n\t\t\t\t\teventName: NativeWindowEvents.activityStopped,\n\t\t\t\t\tobject: nativeWindow,\n\t\t\t\t\twindow: nativeWindow,\n\t\t\t\t\tactivity,\n\t\t\t\t} as AndroidActivityEventData);\n\t\t\t}\n\n\t\t\tApplication.android.notify({\n\t\t\t\teventName: Application.android.activityStoppedEvent,\n\t\t\t\tobject: Application.android,\n\t\t\t\twindow: nativeWindow,\n\t\t\t\tactivity,\n\t\t\t} as AndroidActivityEventData);\n\t\t}\n\n\t\t@profile\n\t\tsetThemeOnLaunch(activity: androidx.appcompat.app.AppCompatActivity) {\n\t\t\t// Set app theme after launch screen was used during startup\n\t\t\tlet setThemeOnLaunch = ApplicationSettings.getNumber('SET_THEME_ON_LAUNCH', -1);\n\t\t\tif (setThemeOnLaunch === -1) {\n\t\t\t\tconst activityInfo = activity.getPackageManager().getActivityInfo(activity.getComponentName(), android.content.pm.PackageManager.GET_META_DATA);\n\t\t\t\tif (activityInfo.metaData) {\n\t\t\t\t\tsetThemeOnLaunch = activityInfo.metaData.getInt('SET_THEME_ON_LAUNCH', -1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (setThemeOnLaunch !== -1) {\n\t\t\t\tactivity.setTheme(setThemeOnLaunch);\n\t\t\t}\n\t\t}\n\n\t\t@profile\n\t\tnotifyActivityCreated(activity: androidx.appcompat.app.AppCompatActivity, bundle: android.os.Bundle, nativeWindow?: NativeWindow) {\n\t\t\t// Emit on NativeWindow first\n\t\t\tif (nativeWindow) {\n\t\t\t\tnativeWindow.notify({\n\t\t\t\t\teventName: NativeWindowEvents.activityCreated,\n\t\t\t\t\tobject: nativeWindow,\n\t\t\t\t\twindow: nativeWindow,\n\t\t\t\t\tactivity,\n\t\t\t\t\tbundle,\n\t\t\t\t} as AndroidActivityBundleEventData);\n\t\t\t}\n\t\t\tApplication.android.notify({\n\t\t\t\teventName: Application.android.activityCreatedEvent,\n\t\t\t\tobject: Application.android,\n\t\t\t\twindow: nativeWindow,\n\t\t\t\tactivity,\n\t\t\t\tbundle,\n\t\t\t} as AndroidActivityBundleEventData);\n\t\t}\n\n\t\t@profile\n\t\tsubscribeForGlobalLayout(activity: androidx.appcompat.app.AppCompatActivity) {\n\t\t\tconst rootView = activity.getWindow().getDecorView().getRootView();\n\t\t\t// store the listener not to trigger GC collection before collecting the method\n\t\t\tglobal.onGlobalLayoutListener = new android.view.ViewTreeObserver.OnGlobalLayoutListener({\n\t\t\t\tonGlobalLayout() {\n\t\t\t\t\tApplication.android.notify({\n\t\t\t\t\t\teventName: Application.displayedEvent,\n\t\t\t\t\t\tobject: Application,\n\t\t\t\t\t\tandroid: Application.android,\n\t\t\t\t\t\tactivity,\n\t\t\t\t\t} as AndroidActivityEventData);\n\t\t\t\t\tconst viewTreeObserver = rootView.getViewTreeObserver();\n\t\t\t\t\tviewTreeObserver.removeOnGlobalLayoutListener(global.onGlobalLayoutListener);\n\t\t\t\t},\n\t\t\t});\n\t\t\trootView.getViewTreeObserver().addOnGlobalLayoutListener(global.onGlobalLayoutListener);\n\t\t}\n\t}\n\n\tNativeScriptLifecycleCallbacks_ = NativeScriptLifecycleCallbacksImpl;\n\treturn NativeScriptLifecycleCallbacks_;\n}\n\ndeclare class NativeScriptComponentCallbacks extends android.content.ComponentCallbacks2 {}\n\nlet NativeScriptComponentCallbacks_: typeof NativeScriptComponentCallbacks;\nfunction initNativeScriptComponentCallbacks() {\n\tif (NativeScriptComponentCallbacks_) {\n\t\treturn NativeScriptComponentCallbacks_;\n\t}\n\n\t@NativeClass\n\t@JavaProxy('org.nativescript.NativeScriptComponentCallbacks')\n\tclass NativeScriptComponentCallbacksImpl extends android.content.ComponentCallbacks2 {\n\t\t@profile\n\t\tpublic onLowMemory(): void {\n\t\t\tgc();\n\t\t\tjava.lang.System.gc();\n\n\t\t\tApplication.notify({\n\t\t\t\teventName: Application.lowMemoryEvent,\n\t\t\t\tobject: Application,\n\t\t\t\tandroid: this,\n\t\t\t} as ApplicationEventData);\n\t\t}\n\n\t\t@profile\n\t\tpublic onTrimMemory(level: number): void {\n\t\t\t// TODO: This is skipped for now, test carefully for OutOfMemory exceptions\n\t\t}\n\n\t\t@profile\n\t\tpublic onConfigurationChanged(newConfiguration: android.content.res.Configuration): void {\n\t\t\tApplication.android.onConfigurationChanged(newConfiguration);\n\t\t}\n\t}\n\n\tNativeScriptComponentCallbacks_ = NativeScriptComponentCallbacksImpl;\n\treturn NativeScriptComponentCallbacks_;\n}\n\ninterface RegisteredReceiverInfo {\n\treceiver: android.content.BroadcastReceiver;\n\tintent: string;\n\tcallback: (context: android.content.Context, intent: android.content.Intent) => void;\n\tid: number;\n\tflags: number;\n}\n\nconst BroadcastReceiver = lazy(() => {\n\t@NativeClass\n\tclass BroadcastReceiverImpl extends android.content.BroadcastReceiver {\n\t\tprivate _onReceiveCallback: (context: android.content.Context, intent: android.content.Intent) => void;\n\n\t\tconstructor(onReceiveCallback: (context: android.content.Context, intent: android.content.Intent) => void) {\n\t\t\tsuper();\n\t\t\tthis._onReceiveCallback = onReceiveCallback;\n\n\t\t\treturn global.__native(this);\n\t\t}\n\n\t\tpublic onReceive(context: android.content.Context, intent: android.content.Intent) {\n\t\t\tif (this._onReceiveCallback) {\n\t\t\t\tthis._onReceiveCallback(context, intent);\n\t\t\t}\n\t\t}\n\t}\n\treturn BroadcastReceiverImpl;\n});\n\nexport class AndroidApplication extends ApplicationCommon {\n\tstatic readonly fragmentCreateEvent = 'fragmentCreate';\n\tstatic readonly activityCreateEvent = 'activityCreate';\n\tstatic readonly activityCreatedEvent = 'activityCreated';\n\tstatic readonly activityDestroyedEvent = 'activityDestroyed';\n\tstatic readonly activityStartedEvent = 'activityStarted';\n\tstatic readonly activityPausedEvent = 'activityPaused';\n\tstatic readonly activityResumedEvent = 'activityResumed';\n\tstatic readonly activityStoppedEvent = 'activityStopped';\n\tstatic readonly saveActivityStateEvent = 'saveActivityState';\n\tstatic readonly activityResultEvent = 'activityResult';\n\tstatic readonly activityBackPressedEvent = 'activityBackPressed';\n\tstatic readonly activityNewIntentEvent = 'activityNewIntent';\n\tstatic readonly activityRequestPermissionsEvent = 'activityRequestPermissions';\n\tstatic readonly dialogOnCreateViewEvent = 'dialogOnCreateView';\n\tstatic readonly configurationChangeEvent = 'configurationChange';\n\n\treadonly fragmentCreateEvent = AndroidApplication.fragmentCreateEvent;\n\treadonly activityCreateEvent = AndroidApplication.activityCreateEvent;\n\treadonly activityCreatedEvent = AndroidApplication.activityCreatedEvent;\n\treadonly activityDestroyedEvent = AndroidApplication.activityDestroyedEvent;\n\treadonly activityStartedEvent = AndroidApplication.activityStartedEvent;\n\treadonly activityPausedEvent = AndroidApplication.activityPausedEvent;\n\treadonly activityResumedEvent = AndroidApplication.activityResumedEvent;\n\treadonly activityStoppedEvent = AndroidApplication.activityStoppedEvent;\n\treadonly saveActivityStateEvent = AndroidApplication.saveActivityStateEvent;\n\treadonly activityResultEvent = AndroidApplication.activityResultEvent;\n\treadonly activityBackPressedEvent = AndroidApplication.activityBackPressedEvent;\n\treadonly activityNewIntentEvent = AndroidApplication.activityNewIntentEvent;\n\treadonly activityRequestPermissionsEvent = AndroidApplication.activityRequestPermissionsEvent;\n\treadonly dialogOnCreateViewEvent = AndroidApplication.activityRequestPermissionsEvent;\n\treadonly configurationChangeEvent = AndroidApplication.activityRequestPermissionsEvent;\n\t// `on` is created in ApplicationCommon as a bound function property. We only re-declare it\n\t// here so Android-specific events get typed callbacks without changing the runtime field.\n\tdeclare on: IAndroidApplication['on'];\n\n\tprivate _nativeApp: android.app.Application;\n\tprivate _context: android.content.Context;\n\tprivate _packageName: string;\n\n\t// we are using these property to store the callbacks to avoid early GC collection which would trigger MarkReachableObjects\n\tprivate lifecycleCallbacks: NativeScriptLifecycleCallbacks;\n\tprivate componentCallbacks: NativeScriptComponentCallbacks;\n\n\t// Windows currently active. Membership, not a count, so a repeated or missing lifecycle\n\t// callback cannot drift the aggregate. The registry owns window lifetime, so nothing here\n\t// outlives the window itself.\n\tprivate _activeWindows = new Set<NativeWindow>();\n\n\tinit(nativeApp: android.app.Application): void {\n\t\tif (!nativeApp || this.nativeApp === nativeApp) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.nativeApp) {\n\t\t\tthrow new Error('Application.android already initialized.');\n\t\t}\n\n\t\ttry {\n\t\t\tthis._nativeApp = nativeApp;\n\t\t\tsetNativeApp(nativeApp);\n\t\t\tthis._context = nativeApp.getApplicationContext();\n\t\t\tthis._prevConfiguration = new android.content.res.Configuration(this._context.getResources().getConfiguration());\n\t\t\tthis._packageName = nativeApp.getPackageName();\n\n\t\t\t// we store those callbacks and add a function for clearing them later so that the objects will be eligable for GC\n\t\t\tthis.lifecycleCallbacks = new (initNativeScriptLifecycleCallbacks())();\n\t\t\tthis.nativeApp.registerActivityLifecycleCallbacks(this.lifecycleCallbacks);\n\n\t\t\tthis.componentCallbacks = new (initNativeScriptComponentCallbacks())();\n\t\t\tthis.nativeApp.registerComponentCallbacks(this.componentCallbacks);\n\n\t\t\tthis._registerPendingReceivers();\n\t\t} catch (err) {\n\t\t\tconsole.error('Error initializing AndroidApplication', err, err.stack);\n\t\t}\n\t}\n\tprivate _registeredReceivers: Record<string, RegisteredReceiverInfo[]> = {};\n\tprivate _registeredReceiversById: Record<number, RegisteredReceiverInfo> = {};\n\tprivate _nextReceiverId: number = 1;\n\tprivate _pendingReceiverRegistrations: Omit<RegisteredReceiverInfo, 'receiver'>[] = [];\n\tprivate _registerPendingReceivers() {\n\t\tthis._pendingReceiverRegistrations.forEach((info) => this._registerReceiver(this.context, info.intent, info.callback, info.flags, info.id));\n\t\tthis._pendingReceiverRegistrations.length = 0;\n\t}\n\tprivate _prevConfiguration: android.content.res.Configuration;\n\tonConfigurationChanged(configuration: android.content.res.Configuration): void {\n\t\tconst diff = configuration.diff(this._prevConfiguration);\n\n\t\t// The application context reports the app-wide configuration, which a window on a\n\t\t// second display or in split-screen does not necessarily share, so the primary\n\t\t// window is asked first. Each window tracks its own through its activity.\n\t\tconst primaryWindow = this.primaryWindow;\n\n\t\tif ((diff & 128) /* ActivityInfo.CONFIG_ORIENTATION */ !== 0) {\n\t\t\tconst nativeApp = Application.android.getNativeApplication();\n\t\t\tconst screenOrientation = (nativeApp.getSystemService(android.content.Context.WINDOW_SERVICE) as android.view.WindowManager).getDefaultDisplay().getRotation();\n\t\t\tlet degrees = 0;\n\t\t\tswitch (screenOrientation) {\n\t\t\t\tcase 1 /* android.view.Surface.ROTATION_90 */:\n\t\t\t\t\tdegrees = 90;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2 /* android.view.Surface.ROTATION_180 */:\n\t\t\t\t\tdegrees = 180;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3 /* android.view.Surface.ROTATION_270 */:\n\t\t\t\t\tdegrees = 270;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tthis.setOrientation(primaryWindow?.orientation() ?? this.getOrientationValue(configuration), degrees);\n\t\t}\n\t\tif ((diff & 512) /* ActivityInfo.CONFIG_UI_MODE */ !== 0) {\n\t\t\tthis.setSystemAppearance(primaryWindow?.systemAppearance() ?? this.getSystemAppearanceValue(configuration));\n\t\t}\n\t\tif ((diff & 1073741824) /* ActivityInfo.CONFIG_FONT_SCALE */ !== 0) {\n\t\t\tfontScaleChanged(Number(configuration.fontScale));\n\t\t}\n\t\tif ((diff & 8192) /* ActivityInfo.CONFIG_LAYOUT_DIRECTION */ !== 0) {\n\t\t\tthis.setLayoutDirection(primaryWindow?.layoutDirection() ?? this.getLayoutDirectionValue(configuration));\n\t\t}\n\t\tthis.notify(<AndroidConfigurationChangeEventData>{ eventName: this.configurationChangeEvent, configuration, diff });\n\t\tthis._prevConfiguration = new android.content.res.Configuration(configuration);\n\t}\n\n\tgetNativeApplication() {\n\t\tlet nativeApp = this.nativeApp;\n\n\t\tif (nativeApp) {\n\t\t\treturn nativeApp;\n\t\t}\n\n\t\tnativeApp = getNativeApp<android.app.Application>();\n\n\t\t// we cannot work without having the app instance\n\t\tif (!nativeApp) {\n\t\t\tthrow new Error(\"Failed to retrieve native Android Application object. If you have a custom android.app.Application type implemented make sure that you've called the 'Application.android.init' method.\");\n\t\t}\n\n\t\treturn nativeApp;\n\t}\n\n\tget nativeApp(): android.app.Application {\n\t\treturn this._nativeApp;\n\t}\n\n\trun(entry?: string | NavigationEntry): void {\n\t\tif (this.started) {\n\t\t\tthrow new Error('Application is already started.');\n\t\t}\n\n\t\tthis.started = true;\n\t\tsetAppMainEntry(typeof entry === 'string' ? { moduleName: entry } : entry);\n\n\t\tif (!this.nativeApp) {\n\t\t\tconst nativeApp = this.getNativeApplication();\n\t\t\tthis.init(nativeApp);\n\t\t}\n\n\t\t// The activity lifecycle callbacks are registered but no activity has been created yet,\n\t\t// so this always precedes the first `windowOpen`.\n\t\tthis.notifyReady();\n\t}\n\n\tget startActivity() {\n\t\treturn androidGetStartActivity();\n\t}\n\n\tget foregroundActivity() {\n\t\treturn androidGetForegroundActivity();\n\t}\n\n\tsetStartActivity(value: androidx.appcompat.app.AppCompatActivity) {\n\t\tandroidSetStartActivity(value);\n\t}\n\n\tsetForegroundActivity(value: androidx.appcompat.app.AppCompatActivity) {\n\t\tandroidSetForegroundActivity(value);\n\t}\n\n\tget paused(): boolean {\n\t\treturn this.suspended;\n\t}\n\n\tget backgrounded(): boolean {\n\t\treturn this.inBackground;\n\t}\n\n\tget context() {\n\t\treturn this._context;\n\t}\n\n\tget packageName() {\n\t\treturn this._packageName;\n\t}\n\n\t// Possible flags are:\n\t// RECEIVER_EXPORTED (2)\n\t// RECEIVER_NOT_EXPORTED (4)\n\t// RECEIVER_VISIBLE_TO_INSTANT_APPS (1)\n\tpublic registerBroadcastReceiver(intentFilter: string, onReceiveCallback: (context: android.content.Context, intent: android.content.Intent) => void, flags = 2): () => void {\n\t\tconst receiverId = this._nextReceiverId++;\n\t\tif (this.context) {\n\t\t\tthis._registerReceiver(this.context, intentFilter, onReceiveCallback, flags, receiverId);\n\t\t} else {\n\t\t\tthis._pendingReceiverRegistrations.push({\n\t\t\t\tintent: intentFilter,\n\t\t\t\tcallback: onReceiveCallback,\n\t\t\t\tid: receiverId,\n\t\t\t\tflags,\n\t\t\t});\n\t\t}\n\t\tlet removed = false;\n\t\treturn () => {\n\t\t\tif (removed) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tremoved = true;\n\t\t\tif (this._registeredReceiversById[receiverId]) {\n\t\t\t\tconst receiverInfo = this._registeredReceiversById[receiverId];\n\t\t\t\tthis.context.unregisterReceiver(receiverInfo.receiver);\n\t\t\t\tthis._registeredReceivers[receiverInfo.intent] = this._registeredReceivers[receiverInfo.intent]?.filter((ri) => ri.id !== receiverId);\n\t\t\t\tdelete this._registeredReceiversById[receiverId];\n\t\t\t} else {\n\t\t\t\tthis._pendingReceiverRegistrations = this._pendingReceiverRegistrations.filter((ri) => ri.id !== receiverId);\n\t\t\t}\n\t\t};\n\t}\n\tprivate _registerReceiver(context: android.content.Context, intentFilter: string, onReceiveCallback: (context: android.content.Context, intent: android.content.Intent) => void, flags: number, id: number): android.content.BroadcastReceiver {\n\t\tconst receiver: android.content.BroadcastReceiver = new (BroadcastReceiver())(onReceiveCallback);\n\t\tif (SDK_VERSION >= 26) {\n\t\t\tcontext.registerReceiver(receiver, new android.content.IntentFilter(intentFilter), flags);\n\t\t} else {\n\t\t\tcontext.registerReceiver(receiver, new android.content.IntentFilter(intentFilter));\n\t\t}\n\t\tconst receiverInfo: RegisteredReceiverInfo = { receiver, intent: intentFilter, callback: onReceiveCallback, id: typeof id === 'number' ? id : this._nextReceiverId++, flags };\n\t\tthis._registeredReceivers[intentFilter] ??= [];\n\t\tthis._registeredReceivers[intentFilter].push(receiverInfo);\n\t\tthis._registeredReceiversById[receiverInfo.id] = receiverInfo;\n\t\treturn receiver;\n\t}\n\n\tpublic unregisterBroadcastReceiver(intentFilter: string): void {\n\t\tconst receivers = this._registeredReceivers[intentFilter];\n\t\tif (receivers) {\n\t\t\treceivers.forEach((receiver) => {\n\t\t\t\tthis.context.unregisterReceiver(receiver.receiver);\n\t\t\t});\n\t\t\tthis._registeredReceivers[intentFilter] = [];\n\t\t}\n\t}\n\n\tpublic getRegisteredBroadcastReceiver(intentFilter: string): android.content.BroadcastReceiver | undefined {\n\t\treturn this._registeredReceivers[intentFilter]?.[0]?.receiver;\n\t}\n\n\tpublic getRegisteredBroadcastReceivers(intentFilter: string): android.content.BroadcastReceiver[] {\n\t\tconst receiversInfo = this._registeredReceivers[intentFilter];\n\t\tif (receiversInfo) {\n\t\t\treturn receiversInfo.map((info) => info.receiver);\n\t\t}\n\t\treturn [];\n\t}\n\n\t// --- NativeWindow registry ---\n\n\t/**\n\t * @internal - Get a NativeWindow by its activity.\n\t */\n\t_getWindowForActivity(activity: androidx.appcompat.app.AppCompatActivity): AndroidNativeWindow | undefined {\n\t\treturn this._windows.find((nw) => nw.android?.activity === activity) as AndroidNativeWindow | undefined;\n\t}\n\n\t/**\n\t * @internal - Feeds a window's active state into the application-level 'resume'/'suspend'\n\t * events, which describe the app as a whole: they are raised when the first window becomes\n\t * active and when the last active one resigns. Callers decide which activities may speak\n\t * for the app; every window reaching here participates.\n\t */\n\t_setWindowActive(nativeWindow: NativeWindow | undefined, active: boolean, activity?: androidx.appcompat.app.AppCompatActivity): void {\n\t\tif (this._trackWindowActive(nativeWindow, active)) {\n\t\t\tthis.setSuspended(!active, {\n\t\t\t\t// todo: deprecate event.android in favor of event.activity\n\t\t\t\tandroid: activity,\n\t\t\t\tactivity,\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * @returns whether the set flipped between empty and non-empty, which is the only point\n\t * at which app-level state changes.\n\t */\n\tprivate _trackWindowActive(nativeWindow: NativeWindow | undefined, active: boolean): boolean {\n\t\tconst wasPopulated = this._activeWindows.size > 0;\n\n\t\t// An activity with no registered window cannot join the aggregate, so it only speaks\n\t\t// for the app while no window holds the state.\n\t\tif (!nativeWindow) {\n\t\t\treturn !wasPopulated;\n\t\t}\n\n\t\tif (active) {\n\t\t\tthis._activeWindows.add(nativeWindow);\n\t\t} else {\n\t\t\tthis._activeWindows.delete(nativeWindow);\n\t\t}\n\n\t\treturn wasPopulated !== this._activeWindows.size > 0;\n\t}\n\n\t// --- Multi-window support ---\n\n\t/**\n\t * Opens a new window by launching the start activity into its own task.\n\t *\n\t * @param options Options for the new window. `options.data` is put on the launch\n\t * intent as extras and surfaces as the window's `data`.\n\t *\n\t * @experimental The start activity's `launchMode` in AndroidManifest.xml decides whether a\n\t * second instance can exist at all: `singleTask` (the app template default) and\n\t * `singleInstance` route the intent to the existing activity's `onNewIntent` instead of\n\t * creating one. `singleInstancePerTask` (API 31+) keeps single-task behavior for launcher\n\t * and deep-link starts while still allowing the `MULTIPLE_TASK`/`NEW_DOCUMENT` launch used\n\t * here; `standard` also works. When the app is already in split-screen, the new window\n\t * opens in the adjacent pane; otherwise it covers the current one and both show in recents.\n\t */\n\topenWindow(options?: WindowOpenOptions): void {\n\t\twarnMultiWindowIsExperimental();\n\n\t\tconst context = this.context ?? this.getNativeApplication();\n\t\tconst intent = new android.content.Intent();\n\t\tconst windowActivities = this._getWindows()\n\t\t\t.filter((window) => window.state === 'attached' && !window._surfaceGone)\n\t\t\t.map((window) => (window as AndroidNativeWindow).activity);\n\t\t// startActivity/foregroundActivity can be third-party (SDK) activities, which must never be relaunched as a window.\n\t\tconst startActivity = [this.startActivity, this.foregroundActivity, ...windowActivities].find((activity) => activity && 'isNativeScriptActivity' in activity && !activity.isFinishing() && !activity.isDestroyed());\n\n\t\tif (startActivity) {\n\t\t\tintent.setClass(context, startActivity.getClass());\n\t\t} else {\n\t\t\tconst component = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName())?.getComponent();\n\t\t\tif (!component) {\n\t\t\t\tthrow new Error('Unable to open a window: no NativeScript activity or launch activity was found.');\n\t\t\t}\n\t\t\tintent.setComponent(component);\n\t\t}\n\n\t\tlet flags = android.content.Intent.FLAG_ACTIVITY_NEW_TASK | android.content.Intent.FLAG_ACTIVITY_MULTIPLE_TASK | android.content.Intent.FLAG_ACTIVITY_NEW_DOCUMENT;\n\n\t\tconst launcher = this.foregroundActivity ?? startActivity;\n\t\tif (SDK_VERSION >= 24 && launcher?.isInMultiWindowMode()) {\n\t\t\tflags |= android.content.Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT;\n\t\t}\n\t\tintent.setFlags(flags);\n\n\t\tconst data = options?.data;\n\t\tif (data) {\n\t\t\tfor (const key of Object.keys(data)) {\n\t\t\t\tintent.putExtra(key, dataSerialize(data[key], true));\n\t\t\t}\n\t\t}\n\n\t\tif (launcher) {\n\t\t\tlauncher.startActivity(intent);\n\t\t} else {\n\t\t\tcontext.startActivity(intent);\n\t\t}\n\t}\n\n\tgetRootView(): View {\n\t\tconst activity = this.startActivity;\n\t\tif (!activity) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst callbacks: AndroidActivityCallbacks = activity['_callbacks'];\n\n\t\tsetRootView(callbacks ? callbacks.getRootView() : undefined);\n\t\treturn getRootView();\n\t}\n\n\tresetRootView(entry?: NavigationEntry | string): void {\n\t\tsuper.resetRootView(entry);\n\n\t\tconst activity = this.startActivity;\n\t\tif (!activity) {\n\t\t\tthrow new Error('Cannot find android activity.');\n\t\t}\n\n\t\t// this.mainEntry = typeof entry === 'string' ? { moduleName: entry } : entry;\n\t\tconst callbacks: AndroidActivityCallbacks = activity['_callbacks'];\n\t\tif (!callbacks) {\n\t\t\tthrow new Error('Cannot find android activity callbacks.');\n\t\t}\n\t\tcallbacks.resetActivityContent(activity);\n\t}\n\n\tgetSystemAppearance(): 'light' | 'dark' {\n\t\treturn this.getSystemAppearanceValue(this.getConfiguration());\n\t}\n\n\tprivate getConfiguration(): android.content.res.Configuration {\n\t\treturn (this.context ?? this.getNativeApplication()).getResources().getConfiguration();\n\t}\n\n\t// https://developer.android.com/guide/topics/ui/look-and-feel/darktheme#configuration_changes\n\tprivate getSystemAppearanceValue(configuration: android.content.res.Configuration): 'dark' | 'light' {\n\t\tconst systemAppearance = configuration.uiMode & android.content.res.Configuration.UI_MODE_NIGHT_MASK;\n\n\t\tswitch (systemAppearance) {\n\t\t\tcase android.content.res.Configuration.UI_MODE_NIGHT_YES:\n\t\t\t\treturn 'dark';\n\t\t\tcase android.content.res.Configuration.UI_MODE_NIGHT_NO:\n\t\t\tcase android.content.res.Configuration.UI_MODE_NIGHT_UNDEFINED:\n\t\t\t\treturn 'light';\n\t\t}\n\t}\n\n\tgetLayoutDirection(): CoreTypes.LayoutDirectionType {\n\t\treturn this.getLayoutDirectionValue(this.getConfiguration());\n\t}\n\n\tprivate getLayoutDirectionValue(configuration: android.content.res.Configuration): CoreTypes.LayoutDirectionType {\n\t\tconst layoutDirection = configuration.getLayoutDirection();\n\n\t\tswitch (layoutDirection) {\n\t\t\tcase android.view.View.LAYOUT_DIRECTION_LTR:\n\t\t\t\treturn CoreTypes.LayoutDirection.ltr;\n\t\t\tcase android.view.View.LAYOUT_DIRECTION_RTL:\n\t\t\t\treturn CoreTypes.LayoutDirection.rtl;\n\t\t}\n\t}\n\n\tgetOrientation() {\n\t\treturn this.getOrientationValue(this.getConfiguration());\n\t}\n\n\tprivate getOrientationValue(configuration: android.content.res.Configuration): 'portrait' | 'landscape' | 'unknown' {\n\t\tconst orientation = configuration.orientation;\n\n\t\tswitch (orientation) {\n\t\t\tcase android.content.res.Configuration.ORIENTATION_LANDSCAPE:\n\t\t\t\treturn 'landscape';\n\t\t\tcase android.content.res.Configuration.ORIENTATION_PORTRAIT:\n\t\t\t\treturn 'portrait';\n\t\t\tdefault:\n\t\t\t\treturn 'unknown';\n\t\t}\n\t}\n\n\tget android() {\n\t\t// ensures Application.android is defined when running on Android\n\t\treturn this;\n\t}\n}\n\nexport * from './application-common';\nexport * from './application-interfaces';\nexport const Application = new AndroidApplication();\nexport const iOSApplication = undefined;\n\nconst applicationEvents: string[] = [Application.orientationChangedEvent, Application.systemAppearanceChangedEvent];\nfunction toggleApplicationEventListeners(toAdd: boolean, callback: (args: ApplicationEventData) => void) {\n\tfor (const eventName of applicationEvents) {\n\t\tif (toAdd) {\n\t\t\tApplication.on(eventName, callback);\n\t\t} else {\n\t\t\tApplication.off(eventName, callback);\n\t\t}\n\t}\n}\nsetToggleApplicationEventListenersCallback(toggleApplicationEventListeners);\n\nsetApplicationPropertiesCallback(() => {\n\treturn {\n\t\torientation: Application.orientation(),\n\t\tsystemAppearance: Application.systemAppearance(),\n\t};\n});\n\nfunction onLiveSync(args): void {\n\tif (getImageFetcher()) {\n\t\tgetImageFetcher().clearCache();\n\t}\n}\n\ngetNativeScriptGlobals().events.on('livesync', onLiveSync);\n\ngetNativeScriptGlobals().addEventWiring(() => {\n\tApplication.android.on('activityStarted', (args: any) => {\n\t\tif (!getImageFetcher()) {\n\t\t\tinitImageCache(args.activity);\n\t\t} else {\n\t\t\tgetImageFetcher().initCache();\n\t\t}\n\t});\n});\n\ngetNativeScriptGlobals().addEventWiring(() => {\n\tApplication.android.on('activityStopped', (args) => {\n\t\tif (getImageFetcher()) {\n\t\t\tgetImageFetcher().closeCache();\n\t\t}\n\t});\n});\n"]}
|
|
1
|
+
{"version":3,"file":"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AAG,EAAE;IACrC,OAAO;QACN,WAAW,EAAE,WAAW,CAAC,WAAW,EAAE;QACtC,gBAAgB,EAAE,WAAW,CAAC,gBAAgB,EAAE;KAChD,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,SAAS,UAAU,CAAC,IAAI;IACvB,IAAI,eAAe,EAAE,EAAE,CAAC;QACvB,eAAe,EAAE,CAAC,UAAU,EAAE,CAAC;IAChC,CAAC;AACF,CAAC;AAED,sBAAsB,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;AAE3D,sBAAsB,EAAE,CAAC,cAAc,CAAC,GAAG,EAAE;IAC5C,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC,iBAAiB,EAAE,CAAC,IAAS,EAAE,EAAE;QACvD,IAAI,CAAC,eAAe,EAAE,EAAE,CAAC;YACxB,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC/B,CAAC;aAAM,CAAC;YACP,eAAe,EAAE,CAAC,SAAS,EAAE,CAAC;QAC/B,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,sBAAsB,EAAE,CAAC,cAAc,CAAC,GAAG,EAAE;IAC5C,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE;QAClD,IAAI,eAAe,EAAE,EAAE,CAAC;YACvB,eAAe,EAAE,CAAC,UAAU,EAAE,CAAC;QAChC,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import * as ApplicationSettings from '../application-settings';\nimport { CoreTypes } from '../core-types';\nimport { profile } from '../profiling';\nimport type { View } from '../ui/core/view';\nimport { AndroidActivityCallbacks, NavigationEntry } from '../ui/frame/frame-common';\nimport { isEmbedded } from '../ui/embedding';\nimport { SDK_VERSION } from '../utils/constants';\nimport { dataSerialize } from '../utils';\nimport { ApplicationCommon } from './application-common';\nimport type { AndroidActivityBundleEventData, AndroidActivityEventData, AndroidConfigurationChangeEventData, ApplicationEventData } from './application-interfaces';\nimport type { AndroidApplication as IAndroidApplication } from './application';\nimport { Trace } from '../trace';\nimport { AndroidNativeWindow } from '../native-window/native-window.android';\nimport { NativeWindow } from '../native-window/native-window-common';\nimport { NativeWindowEvents } from '../native-window/native-window-interfaces';\nimport type { WindowOpenOptions } from '../native-window/native-window-interfaces';\nimport { fontScaleChanged } from '../accessibility/font-scale.android';\nimport { androidGetForegroundActivity, androidGetStartActivity, androidSetForegroundActivity, androidSetStartActivity } from './helpers';\nimport { getImageFetcher, getNativeApp, getRootView, initImageCache, setApplicationPropertiesCallback, setAppMainEntry, setNativeApp, setRootView, setToggleApplicationEventListenersCallback } from './helpers-common';\nimport { getNativeScriptGlobals } from '../globals/global-utils';\nimport lazy from '../utils/lazy';\n\ndeclare class NativeScriptLifecycleCallbacks extends android.app.Application.ActivityLifecycleCallbacks {}\n\nconst WINDOW_ID_EXTRA = 'com.tns.activity.windowId';\n\nlet multiWindowWarned = false;\n\nfunction warnMultiWindowIsExperimental(): void {\n\tif (multiWindowWarned) {\n\t\treturn;\n\t}\n\tmultiWindowWarned = true;\n\n\tconst message = 'Application.android.openWindow() is experimental. The start activity must not use launchMode=\"singleTask\" (the app template default) or \"singleInstance\" in AndroidManifest.xml, or Android hands the launch intent to the existing activity instead of opening a second one; use \"singleInstancePerTask\" (API 31+) or \"standard\".';\n\tTrace.write(message, Trace.categories.Debug, Trace.messageType.warn);\n\tconsole.warn(message);\n}\n\nlet NativeScriptLifecycleCallbacks_: typeof NativeScriptLifecycleCallbacks;\nfunction initNativeScriptLifecycleCallbacks() {\n\tif (NativeScriptLifecycleCallbacks_) {\n\t\treturn NativeScriptLifecycleCallbacks_;\n\t}\n\n\t@NativeClass\n\t@JavaProxy('org.nativescript.NativeScriptLifecycleCallbacks')\n\tclass NativeScriptLifecycleCallbacksImpl extends android.app.Application.ActivityLifecycleCallbacks {\n\t\tprivate activitiesCount: number;\n\t\tprivate nativescriptActivity: androidx.appcompat.app.AppCompatActivity;\n\n\t\t@profile\n\t\tpublic onActivityCreated(activity: androidx.appcompat.app.AppCompatActivity, savedInstanceState: android.os.Bundle): void {\n\t\t\t// console.log('NativeScriptLifecycleCallbacks onActivityCreated');\n\t\t\tthis.setThemeOnLaunch(activity);\n\n\t\t\tif (!Application.android.startActivity) {\n\t\t\t\tApplication.android.setStartActivity(activity);\n\t\t\t}\n\t\t\tif (!Application.android.foregroundActivity) {\n\t\t\t\tApplication.android.setForegroundActivity(activity);\n\t\t\t}\n\n\t\t\tif (!this.nativescriptActivity && 'isNativeScriptActivity' in activity) {\n\t\t\t\tthis.nativescriptActivity = activity;\n\t\t\t}\n\n\t\t\t// Create and register NativeWindow for this activity\n\t\t\tconst savedWindowId = savedInstanceState?.getString(WINDOW_ID_EXTRA);\n\t\t\tconst knownWindow = savedWindowId ? (Application.android.getWindowById(savedWindowId) as AndroidNativeWindow) : undefined;\n\t\t\tlet nativeWindow: AndroidNativeWindow;\n\n\t\t\tif (knownWindow?.state === 'detached') {\n\t\t\t\t// The activity was recreated (rotation, theme change): the same window\n\t\t\t\t// instance carries on, keeping its listeners and identity.\n\t\t\t\tknownWindow._reattach(activity);\n\t\t\t\tnativeWindow = knownWindow;\n\t\t\t} else {\n\t\t\t\tconst isPrimary = Application.android._getWindows().length === 0;\n\t\t\t\t// The role is fixed at creation because it is immutable, and deciding it later would\n\t\t\t\t// mean either a second window for this activity or a window with the wrong role.\n\t\t\t\tnativeWindow = new AndroidNativeWindow(activity, savedWindowId || AndroidNativeWindow.newWindowId(), isPrimary, isEmbedded() ? 'embedded' : 'application');\n\t\t\t\tApplication.android._registerWindow(nativeWindow);\n\t\t\t}\n\n\t\t\tnativeWindow._registerConfigurationCallbacks();\n\t\t\tnativeWindow._notifyEvent(NativeWindowEvents.attached);\n\n\t\t\tthis.notifyActivityCreated(activity, savedInstanceState, nativeWindow);\n\n\t\t\tif (Application.hasListeners(Application.displayedEvent)) {\n\t\t\t\tthis.subscribeForGlobalLayout(activity);\n\t\t\t}\n\t\t}\n\n\t\t@profile\n\t\tpublic onActivityDestroyed(activity: androidx.appcompat.app.AppCompatActivity): void {\n\t\t\t// console.log('NativeScriptLifecycleCallbacks onActivityDestroyed');\n\t\t\tif (activity === Application.android.foregroundActivity) {\n\t\t\t\tApplication.android.setForegroundActivity(undefined);\n\t\t\t}\n\n\t\t\tif (activity === this.nativescriptActivity) {\n\t\t\t\tthis.nativescriptActivity = undefined;\n\t\t\t}\n\n\t\t\tif (activity === Application.android.startActivity) {\n\t\t\t\tApplication.android.setStartActivity(undefined);\n\n\t\t\t\t// Fallback for start activity when it is destroyed but we have a known nativescript activity\n\t\t\t\tif (this.nativescriptActivity) {\n\t\t\t\t\tApplication.android.setStartActivity(this.nativescriptActivity);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst nativeWindow = Application.android._getWindowForActivity(activity);\n\t\t\tif (nativeWindow) {\n\t\t\t\t// Android always pauses before destroying, so the window has normally left the\n\t\t\t\t// active aggregate already; this only keeps a dropped pause from stranding it\n\t\t\t\t// there and wedging the app as never-suspended.\n\t\t\t\tApplication.android._setWindowActive(nativeWindow, false, activity);\n\n\t\t\t\tnativeWindow._surfaceGone = true;\n\n\t\t\t\t// A destroyed activity only ends the window session when it is finishing —\n\t\t\t\t// otherwise Android is recreating it and the same window is reused.\n\t\t\t\tconst isClosing = activity.isFinishing();\n\n\t\t\t\tif (isClosing) {\n\t\t\t\t\tnativeWindow._notifyEvent(NativeWindowEvents.close);\n\t\t\t\t}\n\n\t\t\t\t// Emit activityDestroyed on NativeWindow\n\t\t\t\tnativeWindow.notify({\n\t\t\t\t\teventName: NativeWindowEvents.activityDestroyed,\n\t\t\t\t\tobject: nativeWindow,\n\t\t\t\t\twindow: nativeWindow,\n\t\t\t\t\tactivity,\n\t\t\t\t} as AndroidActivityEventData);\n\n\t\t\t\tif (isClosing) {\n\t\t\t\t\tApplication.android._unregisterWindow(nativeWindow);\n\t\t\t\t} else {\n\t\t\t\t\tnativeWindow._detach();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tApplication.android.notify({\n\t\t\t\teventName: Application.android.activityDestroyedEvent,\n\t\t\t\tobject: Application.android,\n\t\t\t\twindow: nativeWindow,\n\t\t\t\tactivity,\n\t\t\t} as AndroidActivityEventData);\n\n\t\t\t// This callback runs for every activity in the process, not just NativeScript ones,\n\t\t\t// so an empty registry here means the app really has no window left.\n\t\t\tif (activity.isFinishing() && Application.android._getWindows().length === 0) {\n\t\t\t\tApplication.android.notifyExit({ android: activity });\n\t\t\t}\n\n\t\t\t// TODO: This is a temporary workaround to force the V8's Garbage Collector, which will force the related Java Object to be collected.\n\t\t\tgc();\n\t\t}\n\n\t\t@profile\n\t\tpublic onActivityPaused(activity: androidx.appcompat.app.AppCompatActivity): void {\n\t\t\t// console.log('NativeScriptLifecycleCallbacks onActivityPaused');\n\t\t\tconst nativeWindow = Application.android._getWindowForActivity(activity);\n\n\t\t\t// `onActivityCreated` registers a window for every activity in the process, so the\n\t\t\t// window's role cannot tell a NativeScript activity from a third-party one.\n\t\t\tif ('isNativeScriptActivity' in activity) {\n\t\t\t\tApplication.android._setWindowActive(nativeWindow, false, activity);\n\t\t\t}\n\n\t\t\tif (nativeWindow) {\n\t\t\t\tnativeWindow._notifyEvent(NativeWindowEvents.deactivate);\n\t\t\t\t// Emit activityPaused on NativeWindow\n\t\t\t\tnativeWindow.notify({\n\t\t\t\t\teventName: NativeWindowEvents.activityPaused,\n\t\t\t\t\tobject: nativeWindow,\n\t\t\t\t\twindow: nativeWindow,\n\t\t\t\t\tactivity,\n\t\t\t\t} as AndroidActivityEventData);\n\t\t\t}\n\n\t\t\tApplication.android.notify({\n\t\t\t\teventName: Application.android.activityPausedEvent,\n\t\t\t\tobject: Application.android,\n\t\t\t\twindow: nativeWindow,\n\t\t\t\tactivity,\n\t\t\t} as AndroidActivityEventData);\n\t\t}\n\n\t\t@profile\n\t\tpublic onActivityResumed(activity: androidx.appcompat.app.AppCompatActivity): void {\n\t\t\t// console.log('NativeScriptLifecycleCallbacks onActivityResumed');\n\t\t\tApplication.android.setForegroundActivity(activity);\n\n\t\t\tconst nativeWindow = Application.android._getWindowForActivity(activity);\n\t\t\tif (nativeWindow) {\n\t\t\t\tnativeWindow._notifyEvent(NativeWindowEvents.activate);\n\t\t\t\t// Emit activityResumed on NativeWindow\n\t\t\t\tnativeWindow.notify({\n\t\t\t\t\teventName: NativeWindowEvents.activityResumed,\n\t\t\t\t\tobject: nativeWindow,\n\t\t\t\t\twindow: nativeWindow,\n\t\t\t\t\tactivity,\n\t\t\t\t} as AndroidActivityEventData);\n\t\t\t}\n\n\t\t\t// NOTE: setSuspended(false) is called in frame/index.android.ts inside onPostResume\n\t\t\t// This is done to ensure proper timing for the event to be raised\n\n\t\t\tApplication.android.notify({\n\t\t\t\teventName: Application.android.activityResumedEvent,\n\t\t\t\tobject: Application.android,\n\t\t\t\twindow: nativeWindow,\n\t\t\t\tactivity,\n\t\t\t} as AndroidActivityEventData);\n\t\t}\n\n\t\t@profile\n\t\tpublic onActivitySaveInstanceState(activity: androidx.appcompat.app.AppCompatActivity, bundle: android.os.Bundle): void {\n\t\t\t// console.log('NativeScriptLifecycleCallbacks onActivitySaveInstanceState');\n\n\t\t\t// Emit on NativeWindow first\n\t\t\tconst nativeWindow = Application.android._getWindowForActivity(activity);\n\t\t\tif (nativeWindow) {\n\t\t\t\t// Carries the window identity across activity recreation.\n\t\t\t\tbundle.putString(WINDOW_ID_EXTRA, nativeWindow.id);\n\n\t\t\t\tnativeWindow.notify({\n\t\t\t\t\teventName: NativeWindowEvents.saveActivityState,\n\t\t\t\t\tobject: nativeWindow,\n\t\t\t\t\twindow: nativeWindow,\n\t\t\t\t\tactivity,\n\t\t\t\t\tbundle,\n\t\t\t\t} as AndroidActivityBundleEventData);\n\t\t\t}\n\n\t\t\tApplication.android.notify({\n\t\t\t\teventName: Application.android.saveActivityStateEvent,\n\t\t\t\tobject: Application.android,\n\t\t\t\twindow: nativeWindow,\n\t\t\t\tactivity,\n\t\t\t\tbundle,\n\t\t\t} as AndroidActivityBundleEventData);\n\t\t}\n\n\t\t@profile\n\t\tpublic onActivityStarted(activity: androidx.appcompat.app.AppCompatActivity): void {\n\t\t\t// console.log('NativeScriptLifecycleCallbacks onActivityStarted');\n\n\t\t\tthis.activitiesCount = (this.activitiesCount ?? 0) + 1;\n\t\t\tif (this.activitiesCount === 1) {\n\t\t\t\tApplication.android.setInBackground(false, {\n\t\t\t\t\t// todo: deprecate event.android in favor of event.activity\n\t\t\t\t\tandroid: activity,\n\t\t\t\t\tactivity,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst nativeWindow = Application.android._getWindowForActivity(activity);\n\t\t\tif (nativeWindow) {\n\t\t\t\tnativeWindow._notifyEvent(NativeWindowEvents.foreground);\n\t\t\t\t// Emit activityStarted on NativeWindow\n\t\t\t\tnativeWindow.notify({\n\t\t\t\t\teventName: NativeWindowEvents.activityStarted,\n\t\t\t\t\tobject: nativeWindow,\n\t\t\t\t\twindow: nativeWindow,\n\t\t\t\t\tactivity,\n\t\t\t\t} as AndroidActivityEventData);\n\t\t\t}\n\n\t\t\tApplication.android.notify({\n\t\t\t\teventName: Application.android.activityStartedEvent,\n\t\t\t\tobject: Application.android,\n\t\t\t\twindow: nativeWindow,\n\t\t\t\tactivity,\n\t\t\t} as AndroidActivityEventData);\n\t\t}\n\n\t\t@profile\n\t\tpublic onActivityStopped(activity: androidx.appcompat.app.AppCompatActivity): void {\n\t\t\t// console.log('NativeScriptLifecycleCallbacks onActivityStopped');\n\t\t\tthis.activitiesCount--;\n\t\t\tif (this.activitiesCount === 0) {\n\t\t\t\tApplication.android.setInBackground(true, {\n\t\t\t\t\t// todo: deprecate event.android in favor of event.activity\n\t\t\t\t\tandroid: activity,\n\t\t\t\t\tactivity,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst nativeWindow = Application.android._getWindowForActivity(activity);\n\t\t\tif (nativeWindow) {\n\t\t\t\tnativeWindow._notifyEvent(NativeWindowEvents.background);\n\t\t\t\t// Emit activityStopped on NativeWindow\n\t\t\t\tnativeWindow.notify({\n\t\t\t\t\teventName: NativeWindowEvents.activityStopped,\n\t\t\t\t\tobject: nativeWindow,\n\t\t\t\t\twindow: nativeWindow,\n\t\t\t\t\tactivity,\n\t\t\t\t} as AndroidActivityEventData);\n\t\t\t}\n\n\t\t\tApplication.android.notify({\n\t\t\t\teventName: Application.android.activityStoppedEvent,\n\t\t\t\tobject: Application.android,\n\t\t\t\twindow: nativeWindow,\n\t\t\t\tactivity,\n\t\t\t} as AndroidActivityEventData);\n\t\t}\n\n\t\t@profile\n\t\tsetThemeOnLaunch(activity: androidx.appcompat.app.AppCompatActivity) {\n\t\t\t// Set app theme after launch screen was used during startup\n\t\t\tlet setThemeOnLaunch = ApplicationSettings.getNumber('SET_THEME_ON_LAUNCH', -1);\n\t\t\tif (setThemeOnLaunch === -1) {\n\t\t\t\tconst activityInfo = activity.getPackageManager().getActivityInfo(activity.getComponentName(), android.content.pm.PackageManager.GET_META_DATA);\n\t\t\t\tif (activityInfo.metaData) {\n\t\t\t\t\tsetThemeOnLaunch = activityInfo.metaData.getInt('SET_THEME_ON_LAUNCH', -1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (setThemeOnLaunch !== -1) {\n\t\t\t\tactivity.setTheme(setThemeOnLaunch);\n\t\t\t}\n\t\t}\n\n\t\t@profile\n\t\tnotifyActivityCreated(activity: androidx.appcompat.app.AppCompatActivity, bundle: android.os.Bundle, nativeWindow?: NativeWindow) {\n\t\t\t// Emit on NativeWindow first\n\t\t\tif (nativeWindow) {\n\t\t\t\tnativeWindow.notify({\n\t\t\t\t\teventName: NativeWindowEvents.activityCreated,\n\t\t\t\t\tobject: nativeWindow,\n\t\t\t\t\twindow: nativeWindow,\n\t\t\t\t\tactivity,\n\t\t\t\t\tbundle,\n\t\t\t\t} as AndroidActivityBundleEventData);\n\t\t\t}\n\t\t\tApplication.android.notify({\n\t\t\t\teventName: Application.android.activityCreatedEvent,\n\t\t\t\tobject: Application.android,\n\t\t\t\twindow: nativeWindow,\n\t\t\t\tactivity,\n\t\t\t\tbundle,\n\t\t\t} as AndroidActivityBundleEventData);\n\t\t}\n\n\t\t@profile\n\t\tsubscribeForGlobalLayout(activity: androidx.appcompat.app.AppCompatActivity) {\n\t\t\tconst rootView = activity.getWindow().getDecorView().getRootView();\n\t\t\t// store the listener not to trigger GC collection before collecting the method\n\t\t\tglobal.onGlobalLayoutListener = new android.view.ViewTreeObserver.OnGlobalLayoutListener({\n\t\t\t\tonGlobalLayout() {\n\t\t\t\t\tApplication.android.notify({\n\t\t\t\t\t\teventName: Application.displayedEvent,\n\t\t\t\t\t\tobject: Application,\n\t\t\t\t\t\tandroid: Application.android,\n\t\t\t\t\t\tactivity,\n\t\t\t\t\t} as AndroidActivityEventData);\n\t\t\t\t\tconst viewTreeObserver = rootView.getViewTreeObserver();\n\t\t\t\t\tviewTreeObserver.removeOnGlobalLayoutListener(global.onGlobalLayoutListener);\n\t\t\t\t},\n\t\t\t});\n\t\t\trootView.getViewTreeObserver().addOnGlobalLayoutListener(global.onGlobalLayoutListener);\n\t\t}\n\t}\n\n\tNativeScriptLifecycleCallbacks_ = NativeScriptLifecycleCallbacksImpl;\n\treturn NativeScriptLifecycleCallbacks_;\n}\n\ndeclare class NativeScriptComponentCallbacks extends android.content.ComponentCallbacks2 {}\n\nlet NativeScriptComponentCallbacks_: typeof NativeScriptComponentCallbacks;\nfunction initNativeScriptComponentCallbacks() {\n\tif (NativeScriptComponentCallbacks_) {\n\t\treturn NativeScriptComponentCallbacks_;\n\t}\n\n\t@NativeClass\n\t@JavaProxy('org.nativescript.NativeScriptComponentCallbacks')\n\tclass NativeScriptComponentCallbacksImpl extends android.content.ComponentCallbacks2 {\n\t\t@profile\n\t\tpublic onLowMemory(): void {\n\t\t\tgc();\n\t\t\tjava.lang.System.gc();\n\n\t\t\tApplication.notify({\n\t\t\t\teventName: Application.lowMemoryEvent,\n\t\t\t\tobject: Application,\n\t\t\t\tandroid: this,\n\t\t\t} as ApplicationEventData);\n\t\t}\n\n\t\t@profile\n\t\tpublic onTrimMemory(level: number): void {\n\t\t\t// TODO: This is skipped for now, test carefully for OutOfMemory exceptions\n\t\t}\n\n\t\t@profile\n\t\tpublic onConfigurationChanged(newConfiguration: android.content.res.Configuration): void {\n\t\t\tApplication.android.onConfigurationChanged(newConfiguration);\n\t\t}\n\t}\n\n\tNativeScriptComponentCallbacks_ = NativeScriptComponentCallbacksImpl;\n\treturn NativeScriptComponentCallbacks_;\n}\n\ninterface RegisteredReceiverInfo {\n\treceiver: android.content.BroadcastReceiver;\n\tintent: string;\n\tcallback: (context: android.content.Context, intent: android.content.Intent) => void;\n\tid: number;\n\tflags: number;\n}\n\nconst BroadcastReceiver = lazy(() => {\n\t@NativeClass\n\tclass BroadcastReceiverImpl extends android.content.BroadcastReceiver {\n\t\tprivate _onReceiveCallback: (context: android.content.Context, intent: android.content.Intent) => void;\n\n\t\tconstructor(onReceiveCallback: (context: android.content.Context, intent: android.content.Intent) => void) {\n\t\t\tsuper();\n\t\t\tthis._onReceiveCallback = onReceiveCallback;\n\t\t}\n\n\t\tpublic onReceive(context: android.content.Context, intent: android.content.Intent) {\n\t\t\tif (this._onReceiveCallback) {\n\t\t\t\tthis._onReceiveCallback(context, intent);\n\t\t\t}\n\t\t}\n\t}\n\treturn BroadcastReceiverImpl;\n});\n\nexport class AndroidApplication extends ApplicationCommon {\n\tstatic readonly fragmentCreateEvent = 'fragmentCreate';\n\tstatic readonly activityCreateEvent = 'activityCreate';\n\tstatic readonly activityCreatedEvent = 'activityCreated';\n\tstatic readonly activityDestroyedEvent = 'activityDestroyed';\n\tstatic readonly activityStartedEvent = 'activityStarted';\n\tstatic readonly activityPausedEvent = 'activityPaused';\n\tstatic readonly activityResumedEvent = 'activityResumed';\n\tstatic readonly activityStoppedEvent = 'activityStopped';\n\tstatic readonly saveActivityStateEvent = 'saveActivityState';\n\tstatic readonly activityResultEvent = 'activityResult';\n\tstatic readonly activityBackPressedEvent = 'activityBackPressed';\n\tstatic readonly activityNewIntentEvent = 'activityNewIntent';\n\tstatic readonly activityRequestPermissionsEvent = 'activityRequestPermissions';\n\tstatic readonly dialogOnCreateViewEvent = 'dialogOnCreateView';\n\tstatic readonly configurationChangeEvent = 'configurationChange';\n\n\treadonly fragmentCreateEvent = AndroidApplication.fragmentCreateEvent;\n\treadonly activityCreateEvent = AndroidApplication.activityCreateEvent;\n\treadonly activityCreatedEvent = AndroidApplication.activityCreatedEvent;\n\treadonly activityDestroyedEvent = AndroidApplication.activityDestroyedEvent;\n\treadonly activityStartedEvent = AndroidApplication.activityStartedEvent;\n\treadonly activityPausedEvent = AndroidApplication.activityPausedEvent;\n\treadonly activityResumedEvent = AndroidApplication.activityResumedEvent;\n\treadonly activityStoppedEvent = AndroidApplication.activityStoppedEvent;\n\treadonly saveActivityStateEvent = AndroidApplication.saveActivityStateEvent;\n\treadonly activityResultEvent = AndroidApplication.activityResultEvent;\n\treadonly activityBackPressedEvent = AndroidApplication.activityBackPressedEvent;\n\treadonly activityNewIntentEvent = AndroidApplication.activityNewIntentEvent;\n\treadonly activityRequestPermissionsEvent = AndroidApplication.activityRequestPermissionsEvent;\n\treadonly dialogOnCreateViewEvent = AndroidApplication.activityRequestPermissionsEvent;\n\treadonly configurationChangeEvent = AndroidApplication.activityRequestPermissionsEvent;\n\t// `on` is created in ApplicationCommon as a bound function property. We only re-declare it\n\t// here so Android-specific events get typed callbacks without changing the runtime field.\n\tdeclare on: IAndroidApplication['on'];\n\n\tprivate _nativeApp: android.app.Application;\n\tprivate _context: android.content.Context;\n\tprivate _packageName: string;\n\n\t// we are using these property to store the callbacks to avoid early GC collection which would trigger MarkReachableObjects\n\tprivate lifecycleCallbacks: NativeScriptLifecycleCallbacks;\n\tprivate componentCallbacks: NativeScriptComponentCallbacks;\n\n\t// Windows currently active. Membership, not a count, so a repeated or missing lifecycle\n\t// callback cannot drift the aggregate. The registry owns window lifetime, so nothing here\n\t// outlives the window itself.\n\tprivate _activeWindows = new Set<NativeWindow>();\n\n\tinit(nativeApp: android.app.Application): void {\n\t\tif (!nativeApp || this.nativeApp === nativeApp) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.nativeApp) {\n\t\t\tthrow new Error('Application.android already initialized.');\n\t\t}\n\n\t\ttry {\n\t\t\tthis._nativeApp = nativeApp;\n\t\t\tsetNativeApp(nativeApp);\n\t\t\tthis._context = nativeApp.getApplicationContext();\n\t\t\tthis._prevConfiguration = new android.content.res.Configuration(this._context.getResources().getConfiguration());\n\t\t\tthis._packageName = nativeApp.getPackageName();\n\n\t\t\t// we store those callbacks and add a function for clearing them later so that the objects will be eligable for GC\n\t\t\tthis.lifecycleCallbacks = new (initNativeScriptLifecycleCallbacks())();\n\t\t\tthis.nativeApp.registerActivityLifecycleCallbacks(this.lifecycleCallbacks);\n\n\t\t\tthis.componentCallbacks = new (initNativeScriptComponentCallbacks())();\n\t\t\tthis.nativeApp.registerComponentCallbacks(this.componentCallbacks);\n\n\t\t\tthis._registerPendingReceivers();\n\t\t} catch (err) {\n\t\t\tconsole.error('Error initializing AndroidApplication', err, err.stack);\n\t\t}\n\t}\n\tprivate _registeredReceivers: Record<string, RegisteredReceiverInfo[]> = {};\n\tprivate _registeredReceiversById: Record<number, RegisteredReceiverInfo> = {};\n\tprivate _nextReceiverId: number = 1;\n\tprivate _pendingReceiverRegistrations: Omit<RegisteredReceiverInfo, 'receiver'>[] = [];\n\tprivate _registerPendingReceivers() {\n\t\tthis._pendingReceiverRegistrations.forEach((info) => this._registerReceiver(this.context, info.intent, info.callback, info.flags, info.id));\n\t\tthis._pendingReceiverRegistrations.length = 0;\n\t}\n\tprivate _prevConfiguration: android.content.res.Configuration;\n\tonConfigurationChanged(configuration: android.content.res.Configuration): void {\n\t\tconst diff = configuration.diff(this._prevConfiguration);\n\n\t\t// The application context reports the app-wide configuration, which a window on a\n\t\t// second display or in split-screen does not necessarily share, so the primary\n\t\t// window is asked first. Each window tracks its own through its activity.\n\t\tconst primaryWindow = this.primaryWindow;\n\n\t\tif ((diff & 128) /* ActivityInfo.CONFIG_ORIENTATION */ !== 0) {\n\t\t\tconst nativeApp = Application.android.getNativeApplication();\n\t\t\tconst screenOrientation = (nativeApp.getSystemService(android.content.Context.WINDOW_SERVICE) as android.view.WindowManager).getDefaultDisplay().getRotation();\n\t\t\tlet degrees = 0;\n\t\t\tswitch (screenOrientation) {\n\t\t\t\tcase 1 /* android.view.Surface.ROTATION_90 */:\n\t\t\t\t\tdegrees = 90;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2 /* android.view.Surface.ROTATION_180 */:\n\t\t\t\t\tdegrees = 180;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3 /* android.view.Surface.ROTATION_270 */:\n\t\t\t\t\tdegrees = 270;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tthis.setOrientation(primaryWindow?.orientation() ?? this.getOrientationValue(configuration), degrees);\n\t\t}\n\t\tif ((diff & 512) /* ActivityInfo.CONFIG_UI_MODE */ !== 0) {\n\t\t\tthis.setSystemAppearance(primaryWindow?.systemAppearance() ?? this.getSystemAppearanceValue(configuration));\n\t\t}\n\t\tif ((diff & 1073741824) /* ActivityInfo.CONFIG_FONT_SCALE */ !== 0) {\n\t\t\tfontScaleChanged(Number(configuration.fontScale));\n\t\t}\n\t\tif ((diff & 8192) /* ActivityInfo.CONFIG_LAYOUT_DIRECTION */ !== 0) {\n\t\t\tthis.setLayoutDirection(primaryWindow?.layoutDirection() ?? this.getLayoutDirectionValue(configuration));\n\t\t}\n\t\tthis.notify(<AndroidConfigurationChangeEventData>{ eventName: this.configurationChangeEvent, configuration, diff });\n\t\tthis._prevConfiguration = new android.content.res.Configuration(configuration);\n\t}\n\n\tgetNativeApplication() {\n\t\tlet nativeApp = this.nativeApp;\n\n\t\tif (nativeApp) {\n\t\t\treturn nativeApp;\n\t\t}\n\n\t\tnativeApp = getNativeApp<android.app.Application>();\n\n\t\t// we cannot work without having the app instance\n\t\tif (!nativeApp) {\n\t\t\tthrow new Error(\"Failed to retrieve native Android Application object. If you have a custom android.app.Application type implemented make sure that you've called the 'Application.android.init' method.\");\n\t\t}\n\n\t\treturn nativeApp;\n\t}\n\n\tget nativeApp(): android.app.Application {\n\t\treturn this._nativeApp;\n\t}\n\n\trun(entry?: string | NavigationEntry): void {\n\t\tif (this.started) {\n\t\t\tthrow new Error('Application is already started.');\n\t\t}\n\n\t\tthis.started = true;\n\t\tsetAppMainEntry(typeof entry === 'string' ? { moduleName: entry } : entry);\n\n\t\tif (!this.nativeApp) {\n\t\t\tconst nativeApp = this.getNativeApplication();\n\t\t\tthis.init(nativeApp);\n\t\t}\n\n\t\t// The activity lifecycle callbacks are registered but no activity has been created yet,\n\t\t// so this always precedes the first `windowOpen`.\n\t\tthis.notifyReady();\n\t}\n\n\tget startActivity() {\n\t\treturn androidGetStartActivity();\n\t}\n\n\tget foregroundActivity() {\n\t\treturn androidGetForegroundActivity();\n\t}\n\n\tsetStartActivity(value: androidx.appcompat.app.AppCompatActivity) {\n\t\tandroidSetStartActivity(value);\n\t}\n\n\tsetForegroundActivity(value: androidx.appcompat.app.AppCompatActivity) {\n\t\tandroidSetForegroundActivity(value);\n\t}\n\n\tget paused(): boolean {\n\t\treturn this.suspended;\n\t}\n\n\tget backgrounded(): boolean {\n\t\treturn this.inBackground;\n\t}\n\n\tget context() {\n\t\treturn this._context;\n\t}\n\n\tget packageName() {\n\t\treturn this._packageName;\n\t}\n\n\t// Possible flags are:\n\t// RECEIVER_EXPORTED (2)\n\t// RECEIVER_NOT_EXPORTED (4)\n\t// RECEIVER_VISIBLE_TO_INSTANT_APPS (1)\n\tpublic registerBroadcastReceiver(intentFilter: string, onReceiveCallback: (context: android.content.Context, intent: android.content.Intent) => void, flags = 2): () => void {\n\t\tconst receiverId = this._nextReceiverId++;\n\t\tif (this.context) {\n\t\t\tthis._registerReceiver(this.context, intentFilter, onReceiveCallback, flags, receiverId);\n\t\t} else {\n\t\t\tthis._pendingReceiverRegistrations.push({\n\t\t\t\tintent: intentFilter,\n\t\t\t\tcallback: onReceiveCallback,\n\t\t\t\tid: receiverId,\n\t\t\t\tflags,\n\t\t\t});\n\t\t}\n\t\tlet removed = false;\n\t\treturn () => {\n\t\t\tif (removed) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tremoved = true;\n\t\t\tif (this._registeredReceiversById[receiverId]) {\n\t\t\t\tconst receiverInfo = this._registeredReceiversById[receiverId];\n\t\t\t\tthis.context.unregisterReceiver(receiverInfo.receiver);\n\t\t\t\tthis._registeredReceivers[receiverInfo.intent] = this._registeredReceivers[receiverInfo.intent]?.filter((ri) => ri.id !== receiverId);\n\t\t\t\tdelete this._registeredReceiversById[receiverId];\n\t\t\t} else {\n\t\t\t\tthis._pendingReceiverRegistrations = this._pendingReceiverRegistrations.filter((ri) => ri.id !== receiverId);\n\t\t\t}\n\t\t};\n\t}\n\tprivate _registerReceiver(context: android.content.Context, intentFilter: string, onReceiveCallback: (context: android.content.Context, intent: android.content.Intent) => void, flags: number, id: number): android.content.BroadcastReceiver {\n\t\tconst receiver: android.content.BroadcastReceiver = new (BroadcastReceiver())(onReceiveCallback);\n\t\tif (SDK_VERSION >= 26) {\n\t\t\tcontext.registerReceiver(receiver, new android.content.IntentFilter(intentFilter), flags);\n\t\t} else {\n\t\t\tcontext.registerReceiver(receiver, new android.content.IntentFilter(intentFilter));\n\t\t}\n\t\tconst receiverInfo: RegisteredReceiverInfo = { receiver, intent: intentFilter, callback: onReceiveCallback, id: typeof id === 'number' ? id : this._nextReceiverId++, flags };\n\t\tthis._registeredReceivers[intentFilter] ??= [];\n\t\tthis._registeredReceivers[intentFilter].push(receiverInfo);\n\t\tthis._registeredReceiversById[receiverInfo.id] = receiverInfo;\n\t\treturn receiver;\n\t}\n\n\tpublic unregisterBroadcastReceiver(intentFilter: string): void {\n\t\tconst receivers = this._registeredReceivers[intentFilter];\n\t\tif (receivers) {\n\t\t\treceivers.forEach((receiver) => {\n\t\t\t\tthis.context.unregisterReceiver(receiver.receiver);\n\t\t\t});\n\t\t\tthis._registeredReceivers[intentFilter] = [];\n\t\t}\n\t}\n\n\tpublic getRegisteredBroadcastReceiver(intentFilter: string): android.content.BroadcastReceiver | undefined {\n\t\treturn this._registeredReceivers[intentFilter]?.[0]?.receiver;\n\t}\n\n\tpublic getRegisteredBroadcastReceivers(intentFilter: string): android.content.BroadcastReceiver[] {\n\t\tconst receiversInfo = this._registeredReceivers[intentFilter];\n\t\tif (receiversInfo) {\n\t\t\treturn receiversInfo.map((info) => info.receiver);\n\t\t}\n\t\treturn [];\n\t}\n\n\t// --- NativeWindow registry ---\n\n\t/**\n\t * @internal - Get a NativeWindow by its activity.\n\t */\n\t_getWindowForActivity(activity: androidx.appcompat.app.AppCompatActivity): AndroidNativeWindow | undefined {\n\t\treturn this._windows.find((nw) => nw.android?.activity === activity) as AndroidNativeWindow | undefined;\n\t}\n\n\t/**\n\t * @internal - Feeds a window's active state into the application-level 'resume'/'suspend'\n\t * events, which describe the app as a whole: they are raised when the first window becomes\n\t * active and when the last active one resigns. Callers decide which activities may speak\n\t * for the app; every window reaching here participates.\n\t */\n\t_setWindowActive(nativeWindow: NativeWindow | undefined, active: boolean, activity?: androidx.appcompat.app.AppCompatActivity): void {\n\t\tif (this._trackWindowActive(nativeWindow, active)) {\n\t\t\tthis.setSuspended(!active, {\n\t\t\t\t// todo: deprecate event.android in favor of event.activity\n\t\t\t\tandroid: activity,\n\t\t\t\tactivity,\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * @returns whether the set flipped between empty and non-empty, which is the only point\n\t * at which app-level state changes.\n\t */\n\tprivate _trackWindowActive(nativeWindow: NativeWindow | undefined, active: boolean): boolean {\n\t\tconst wasPopulated = this._activeWindows.size > 0;\n\n\t\t// An activity with no registered window cannot join the aggregate, so it only speaks\n\t\t// for the app while no window holds the state.\n\t\tif (!nativeWindow) {\n\t\t\treturn !wasPopulated;\n\t\t}\n\n\t\tif (active) {\n\t\t\tthis._activeWindows.add(nativeWindow);\n\t\t} else {\n\t\t\tthis._activeWindows.delete(nativeWindow);\n\t\t}\n\n\t\treturn wasPopulated !== this._activeWindows.size > 0;\n\t}\n\n\t// --- Multi-window support ---\n\n\t/**\n\t * Opens a new window by launching the start activity into its own task.\n\t *\n\t * @param options Options for the new window. `options.data` is put on the launch\n\t * intent as extras and surfaces as the window's `data`.\n\t *\n\t * @experimental The start activity's `launchMode` in AndroidManifest.xml decides whether a\n\t * second instance can exist at all: `singleTask` (the app template default) and\n\t * `singleInstance` route the intent to the existing activity's `onNewIntent` instead of\n\t * creating one. `singleInstancePerTask` (API 31+) keeps single-task behavior for launcher\n\t * and deep-link starts while still allowing the `MULTIPLE_TASK`/`NEW_DOCUMENT` launch used\n\t * here; `standard` also works. When the app is already in split-screen, the new window\n\t * opens in the adjacent pane; otherwise it covers the current one and both show in recents.\n\t */\n\topenWindow(options?: WindowOpenOptions): void {\n\t\twarnMultiWindowIsExperimental();\n\n\t\tconst context = this.context ?? this.getNativeApplication();\n\t\tconst intent = new android.content.Intent();\n\t\tconst windowActivities = this._getWindows()\n\t\t\t.filter((window) => window.state === 'attached' && !window._surfaceGone)\n\t\t\t.map((window) => (window as AndroidNativeWindow).activity);\n\t\t// startActivity/foregroundActivity can be third-party (SDK) activities, which must never be relaunched as a window.\n\t\tconst startActivity = [this.startActivity, this.foregroundActivity, ...windowActivities].find((activity) => activity && 'isNativeScriptActivity' in activity && !activity.isFinishing() && !activity.isDestroyed());\n\n\t\tif (startActivity) {\n\t\t\tintent.setClass(context, startActivity.getClass());\n\t\t} else {\n\t\t\tconst component = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName())?.getComponent();\n\t\t\tif (!component) {\n\t\t\t\tthrow new Error('Unable to open a window: no NativeScript activity or launch activity was found.');\n\t\t\t}\n\t\t\tintent.setComponent(component);\n\t\t}\n\n\t\tlet flags = android.content.Intent.FLAG_ACTIVITY_NEW_TASK | android.content.Intent.FLAG_ACTIVITY_MULTIPLE_TASK | android.content.Intent.FLAG_ACTIVITY_NEW_DOCUMENT;\n\n\t\tconst launcher = this.foregroundActivity ?? startActivity;\n\t\tif (SDK_VERSION >= 24 && launcher?.isInMultiWindowMode()) {\n\t\t\tflags |= android.content.Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT;\n\t\t}\n\t\tintent.setFlags(flags);\n\n\t\tconst data = options?.data;\n\t\tif (data) {\n\t\t\tfor (const key of Object.keys(data)) {\n\t\t\t\tintent.putExtra(key, dataSerialize(data[key], true));\n\t\t\t}\n\t\t}\n\n\t\tif (launcher) {\n\t\t\tlauncher.startActivity(intent);\n\t\t} else {\n\t\t\tcontext.startActivity(intent);\n\t\t}\n\t}\n\n\tgetRootView(): View {\n\t\tconst activity = this.startActivity;\n\t\tif (!activity) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst callbacks: AndroidActivityCallbacks = activity['_callbacks'];\n\n\t\tsetRootView(callbacks ? callbacks.getRootView() : undefined);\n\t\treturn getRootView();\n\t}\n\n\tresetRootView(entry?: NavigationEntry | string): void {\n\t\tsuper.resetRootView(entry);\n\n\t\tconst activity = this.startActivity;\n\t\tif (!activity) {\n\t\t\tthrow new Error('Cannot find android activity.');\n\t\t}\n\n\t\t// this.mainEntry = typeof entry === 'string' ? { moduleName: entry } : entry;\n\t\tconst callbacks: AndroidActivityCallbacks = activity['_callbacks'];\n\t\tif (!callbacks) {\n\t\t\tthrow new Error('Cannot find android activity callbacks.');\n\t\t}\n\t\tcallbacks.resetActivityContent(activity);\n\t}\n\n\tgetSystemAppearance(): 'light' | 'dark' {\n\t\treturn this.getSystemAppearanceValue(this.getConfiguration());\n\t}\n\n\tprivate getConfiguration(): android.content.res.Configuration {\n\t\treturn (this.context ?? this.getNativeApplication()).getResources().getConfiguration();\n\t}\n\n\t// https://developer.android.com/guide/topics/ui/look-and-feel/darktheme#configuration_changes\n\tprivate getSystemAppearanceValue(configuration: android.content.res.Configuration): 'dark' | 'light' {\n\t\tconst systemAppearance = configuration.uiMode & android.content.res.Configuration.UI_MODE_NIGHT_MASK;\n\n\t\tswitch (systemAppearance) {\n\t\t\tcase android.content.res.Configuration.UI_MODE_NIGHT_YES:\n\t\t\t\treturn 'dark';\n\t\t\tcase android.content.res.Configuration.UI_MODE_NIGHT_NO:\n\t\t\tcase android.content.res.Configuration.UI_MODE_NIGHT_UNDEFINED:\n\t\t\t\treturn 'light';\n\t\t}\n\t}\n\n\tgetLayoutDirection(): CoreTypes.LayoutDirectionType {\n\t\treturn this.getLayoutDirectionValue(this.getConfiguration());\n\t}\n\n\tprivate getLayoutDirectionValue(configuration: android.content.res.Configuration): CoreTypes.LayoutDirectionType {\n\t\tconst layoutDirection = configuration.getLayoutDirection();\n\n\t\tswitch (layoutDirection) {\n\t\t\tcase android.view.View.LAYOUT_DIRECTION_LTR:\n\t\t\t\treturn CoreTypes.LayoutDirection.ltr;\n\t\t\tcase android.view.View.LAYOUT_DIRECTION_RTL:\n\t\t\t\treturn CoreTypes.LayoutDirection.rtl;\n\t\t}\n\t}\n\n\tgetOrientation() {\n\t\treturn this.getOrientationValue(this.getConfiguration());\n\t}\n\n\tprivate getOrientationValue(configuration: android.content.res.Configuration): 'portrait' | 'landscape' | 'unknown' {\n\t\tconst orientation = configuration.orientation;\n\n\t\tswitch (orientation) {\n\t\t\tcase android.content.res.Configuration.ORIENTATION_LANDSCAPE:\n\t\t\t\treturn 'landscape';\n\t\t\tcase android.content.res.Configuration.ORIENTATION_PORTRAIT:\n\t\t\t\treturn 'portrait';\n\t\t\tdefault:\n\t\t\t\treturn 'unknown';\n\t\t}\n\t}\n\n\tget android() {\n\t\t// ensures Application.android is defined when running on Android\n\t\treturn this;\n\t}\n}\n\nexport * from './application-common';\nexport * from './application-interfaces';\nexport const Application = new AndroidApplication();\nexport const iOSApplication = undefined;\n\nconst applicationEvents: string[] = [Application.orientationChangedEvent, Application.systemAppearanceChangedEvent];\nfunction toggleApplicationEventListeners(toAdd: boolean, callback: (args: ApplicationEventData) => void) {\n\tfor (const eventName of applicationEvents) {\n\t\tif (toAdd) {\n\t\t\tApplication.on(eventName, callback);\n\t\t} else {\n\t\t\tApplication.off(eventName, callback);\n\t\t}\n\t}\n}\nsetToggleApplicationEventListenersCallback(toggleApplicationEventListeners);\n\nsetApplicationPropertiesCallback(() => {\n\treturn {\n\t\torientation: Application.orientation(),\n\t\tsystemAppearance: Application.systemAppearance(),\n\t};\n});\n\nfunction onLiveSync(args): void {\n\tif (getImageFetcher()) {\n\t\tgetImageFetcher().clearCache();\n\t}\n}\n\ngetNativeScriptGlobals().events.on('livesync', onLiveSync);\n\ngetNativeScriptGlobals().addEventWiring(() => {\n\tApplication.android.on('activityStarted', (args: any) => {\n\t\tif (!getImageFetcher()) {\n\t\t\tinitImageCache(args.activity);\n\t\t} else {\n\t\t\tgetImageFetcher().initCache();\n\t\t}\n\t});\n});\n\ngetNativeScriptGlobals().addEventWiring(() => {\n\tApplication.android.on('activityStopped', (args) => {\n\t\tif (getImageFetcher()) {\n\t\t\tgetImageFetcher().closeCache();\n\t\t}\n\t});\n});\n"]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { profile } from '../profiling';
|
|
2
|
-
import { ContentView } from '../ui/content-view';
|
|
3
2
|
import { isEmbedded } from '../ui/embedding';
|
|
4
3
|
import { IOSHelper } from '../ui/core/view/view-helper';
|
|
5
4
|
import { getWindow } from '../utils/native-helper';
|
|
@@ -12,7 +11,7 @@ import { IOSNativeWindow } from '../native-window/native-window.ios';
|
|
|
12
11
|
import { NativeWindow } from '../native-window/native-window-common';
|
|
13
12
|
import { NativeWindowEvents } from '../native-window/native-window-interfaces';
|
|
14
13
|
import { CoreTypes } from '../core-types';
|
|
15
|
-
import { getiOSWindow, setApplicationPropertiesCallback, setAppMainEntry, setiOSWindow, setRootView, setToggleApplicationEventListenersCallback } from './helpers-common';
|
|
14
|
+
import { createContentView, getiOSWindow, setApplicationPropertiesCallback, setAppMainEntry, setiOSWindow, setRootView, setToggleApplicationEventListenersCallback } from './helpers-common';
|
|
16
15
|
var NotificationObserver = (function (_super) {
|
|
17
16
|
__extends(NotificationObserver, _super);
|
|
18
17
|
function NotificationObserver() {
|
|
@@ -917,11 +916,12 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
917
916
|
}
|
|
918
917
|
getSystemAppearance() {
|
|
919
918
|
// userInterfaceStyle is available on UITraitCollection since iOS 12.
|
|
920
|
-
if (
|
|
919
|
+
if (!__VISIONOS__ && SDK_VERSION <= 11) {
|
|
921
920
|
return null;
|
|
922
921
|
}
|
|
923
|
-
|
|
924
|
-
|
|
922
|
+
// the launch event fires before the window has a root view controller: the screen traits are enough then
|
|
923
|
+
const traits = this.rootController?.traitCollection ?? this.window?.traitCollection ?? UIScreen.mainScreen.traitCollection;
|
|
924
|
+
return this.getSystemAppearanceValue(traits.userInterfaceStyle);
|
|
925
925
|
}
|
|
926
926
|
getSystemAppearanceValue(userInterfaceStyle) {
|
|
927
927
|
switch (userInterfaceStyle) {
|
|
@@ -1020,7 +1020,7 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
1020
1020
|
* window's actual root view (see `_contentHosts`).
|
|
1021
1021
|
*/
|
|
1022
1022
|
setHostedWindowContent(window, userView) {
|
|
1023
|
-
const host =
|
|
1023
|
+
const host = createContentView();
|
|
1024
1024
|
this._contentHosts.add(host);
|
|
1025
1025
|
// Sets the host up as a root view (CSS classes, native controller) and, for the primary
|
|
1026
1026
|
// window, raises `initRootView` for it through `contentLoaded` -> `adoptRootView`.
|
|
@@ -1062,7 +1062,7 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
1062
1062
|
if (this._rootView) {
|
|
1063
1063
|
this._rootView._onRootViewReset();
|
|
1064
1064
|
}
|
|
1065
|
-
const rootView =
|
|
1065
|
+
const rootView = createContentView();
|
|
1066
1066
|
this._contentHosts.add(rootView);
|
|
1067
1067
|
const controller = this.getViewController(rootView);
|
|
1068
1068
|
// setup view as styleScopeHost
|
|
@@ -1169,11 +1169,7 @@ export class iOSApplication extends ApplicationCommon {
|
|
|
1169
1169
|
}
|
|
1170
1170
|
}
|
|
1171
1171
|
willTerminate(notification) {
|
|
1172
|
-
this.
|
|
1173
|
-
eventName: this.exitEvent,
|
|
1174
|
-
object: this,
|
|
1175
|
-
ios: this.ios,
|
|
1176
|
-
});
|
|
1172
|
+
this.notifyExit({ ios: this.ios });
|
|
1177
1173
|
// const rootView = this._rootView;
|
|
1178
1174
|
// if (rootView && rootView.isLoaded) {
|
|
1179
1175
|
// rootView.callUnloaded();
|