@nativescript/core 9.0.0-alpha.0 → 9.0.0-alpha.10
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/accessibility/accessibility-common.d.ts +264 -0
- package/accessibility/accessibility-common.js +352 -0
- package/accessibility/accessibility-common.js.map +1 -1
- package/accessibility/accessibility-properties.d.ts +1 -1
- package/accessibility/accessibility-properties.js +2 -2
- package/accessibility/accessibility-properties.js.map +1 -1
- package/accessibility/index.d.ts +0 -36
- package/accessibility/index.js +2 -0
- package/accessibility/index.js.map +1 -0
- package/application/application-common.d.ts +7 -8
- package/application/application-common.js +62 -14
- package/application/application-common.js.map +1 -1
- package/application/application-interfaces.d.ts +2 -3
- package/application/application.android.d.ts +14 -7
- package/application/application.android.js +757 -76
- package/application/application.android.js.map +1 -1
- package/application/application.d.ts +25 -0
- package/application/application.ios.d.ts +16 -18
- package/application/application.ios.js +472 -46
- package/application/application.ios.js.map +1 -1
- package/application/helpers-common.d.ts +50 -0
- package/application/helpers-common.js +153 -0
- package/application/helpers-common.js.map +1 -0
- package/application/helpers.android.d.ts +17 -0
- package/application/helpers.android.js +173 -0
- package/application/helpers.android.js.map +1 -0
- package/application/helpers.d.ts +25 -0
- package/application/helpers.ios.d.ts +27 -0
- package/application/helpers.ios.js +62 -0
- package/application/helpers.ios.js.map +1 -0
- package/application-settings/index.android.js +2 -2
- package/application-settings/index.android.js.map +1 -1
- package/cli-hooks/{before-checkForChanges.js → before-checkForChanges.mjs} +6 -6
- package/cli-hooks/postinstall.mjs +7 -0
- package/cli-hooks/preuninstall.mjs +7 -0
- package/color/color-common.d.ts +18 -19
- package/color/color-common.js +13 -14
- package/color/color-common.js.map +1 -1
- package/color/color-types.d.ts +49 -0
- package/color/color-types.js +3 -0
- package/color/color-types.js.map +1 -0
- package/color/index.ios.d.ts +2 -1
- package/color/index.ios.js.map +1 -1
- package/connectivity/index.android.js +5 -4
- package/connectivity/index.android.js.map +1 -1
- package/core-types/animation-types.d.ts +11 -0
- package/{ui/animation/animation-interfaces.js → core-types/animation-types.js} +1 -1
- package/core-types/animation-types.js.map +1 -0
- package/core-types/index.d.ts +1 -1
- package/core-types/index.js +2 -2
- package/core-types/index.js.map +1 -1
- package/core-types/validators.d.ts +2 -0
- package/core-types/validators.js +18 -0
- package/core-types/validators.js.map +1 -0
- package/css/css-tree-parser.js +17 -21
- package/css/css-tree-parser.js.map +1 -1
- package/css/lib/parse/index.d.ts +1 -0
- package/css/lib/parse/index.js +475 -577
- package/css/lib/parse/index.js.map +1 -0
- package/css/reworkcss.d.ts +25 -28
- package/css/reworkcss.js +5 -1
- package/css/reworkcss.js.map +1 -0
- package/css-mediaquery/index.js +1 -1
- package/css-mediaquery/index.js.map +1 -1
- package/css-value/reworkcss-value.d.ts +31 -8
- package/css-value/reworkcss-value.js +89 -111
- package/css-value/reworkcss-value.js.map +1 -0
- package/debugger/devtools-elements-interfaces.d.ts +1 -1
- package/debugger/devtools-elements.common.js +17 -8
- package/debugger/devtools-elements.common.js.map +1 -1
- package/debugger/devtools-elements.js +1 -1
- package/debugger/devtools-elements.js.map +1 -1
- package/debugger/dom-types.d.ts +24 -0
- package/debugger/{dom-node.js → dom-types.js} +11 -9
- package/debugger/dom-types.js.map +1 -0
- package/debugger/webinspector-css.d.ts +18 -18
- package/debugger/webinspector-css.js +1 -1
- package/debugger/webinspector-css.js.map +1 -1
- package/debugger/webinspector-dom.d.ts +15 -15
- package/debugger/webinspector-dom.js +1 -1
- package/debugger/webinspector-dom.js.map +1 -1
- package/debugger/webinspector-network.android.d.ts +9 -9
- package/debugger/webinspector-network.android.js +3 -3
- package/debugger/webinspector-network.android.js.map +1 -1
- package/debugger/webinspector-network.ios.d.ts +9 -9
- package/debugger/webinspector-network.ios.js +1 -1
- package/debugger/webinspector-network.ios.js.map +1 -1
- package/fetch/index.d.ts +72 -0
- package/fetch/index.js +448 -458
- package/fetch/index.js.map +1 -0
- package/file-system/file-system-access.android.js +32 -39
- package/file-system/file-system-access.android.js.map +1 -1
- package/file-system/file-system-access.ios.js +2 -15
- package/file-system/file-system-access.ios.js.map +1 -1
- package/file-system/index.d.ts +2 -2
- package/file-system/index.js +4 -11
- package/file-system/index.js.map +1 -1
- package/fps-meter/fps-native.android.d.ts +1 -2
- package/fps-meter/fps-native.android.js.map +1 -1
- package/fps-meter/fps-native.ios.d.ts +1 -2
- package/fps-meter/fps-native.ios.js.map +1 -1
- package/global-types.d.ts +7 -8
- package/globals/global-utils.d.ts +27 -0
- package/globals/global-utils.js +67 -0
- package/globals/global-utils.js.map +1 -0
- package/globals/index.d.ts +3 -7
- package/globals/index.js +276 -281
- package/globals/index.js.map +1 -1
- package/http/http-interfaces.d.ts +84 -0
- package/http/http-interfaces.js +6 -0
- package/http/http-interfaces.js.map +1 -0
- package/http/http-request/http-request-common.js +2 -2
- package/http/http-request/http-request-common.js.map +1 -1
- package/http/http-request/index.android.d.ts +3 -7
- package/http/http-request/index.android.js +6 -22
- package/http/http-request/index.android.js.map +1 -1
- package/http/http-request/index.d.ts +5 -1
- package/http/http-request/index.ios.d.ts +3 -7
- package/http/http-request/index.ios.js +6 -22
- package/http/http-request/index.ios.js.map +1 -1
- package/http/http-shared.d.ts +5 -0
- package/http/http-shared.js +14 -0
- package/http/http-shared.js.map +1 -0
- package/http/index.d.ts +6 -105
- package/http/index.js +10 -12
- package/http/index.js.map +1 -1
- package/image-asset/index.android.js +3 -3
- package/image-asset/index.android.js.map +1 -1
- package/image-source/index.android.d.ts +1 -1
- package/image-source/index.android.js +5 -23
- package/image-source/index.android.js.map +1 -1
- package/image-source/index.ios.js +2 -9
- package/image-source/index.ios.js.map +1 -1
- package/index.d.ts +12 -8
- package/index.js +6 -3
- package/index.js.map +1 -1
- package/inspector_modules.d.ts +6 -0
- package/inspector_modules.js +116 -3
- package/inspector_modules.js.map +1 -1
- package/js-libs/easysax/easysax.js +5 -3
- package/media-query-list/index.js +7 -17
- package/media-query-list/index.js.map +1 -1
- package/module-name-resolver/helpers.d.ts +14 -0
- package/module-name-resolver/helpers.js +27 -0
- package/module-name-resolver/helpers.js.map +1 -0
- package/module-name-resolver/index.d.ts +12 -22
- package/module-name-resolver/index.js +6 -18
- package/module-name-resolver/index.js.map +1 -1
- package/module-name-resolver/non-bundle-workflow-compat.js +32 -23
- package/module-name-resolver/non-bundle-workflow-compat.js.map +1 -1
- package/module-name-resolver/qualifier-matcher/index.d.ts +6 -12
- package/module-name-resolver/qualifier-matcher/index.js +5 -5
- package/module-name-resolver/qualifier-matcher/index.js.map +1 -1
- package/package.json +12 -8
- package/platform/device/index.android.js +2 -2
- package/platform/device/index.android.js.map +1 -1
- package/platform/screen/index.android.js +2 -2
- package/platform/screen/index.android.js.map +1 -1
- package/platform/screen/index.ios.js +2 -2
- package/platform/screen/index.ios.js.map +1 -1
- package/platforms/android/widgets-release.aar +0 -0
- package/profiling/index.js +2 -1
- package/profiling/index.js.map +1 -1
- package/ui/action-bar/action-bar-common.js +4 -2
- package/ui/action-bar/action-bar-common.js.map +1 -1
- package/ui/action-bar/index.android.d.ts +0 -4
- package/ui/action-bar/index.android.js +7 -6
- package/ui/action-bar/index.android.js.map +1 -1
- package/ui/action-bar/index.ios.d.ts +1 -11
- package/ui/action-bar/index.ios.js +36 -11
- package/ui/action-bar/index.ios.js.map +1 -1
- package/ui/activity-indicator/index.android.d.ts +0 -3
- package/ui/activity-indicator/index.ios.d.ts +0 -3
- package/ui/activity-indicator/index.ios.js +3 -4
- package/ui/activity-indicator/index.ios.js.map +1 -1
- package/ui/animation/animation-common.d.ts +4 -4
- package/ui/animation/animation-common.js +2 -3
- package/ui/animation/animation-common.js.map +1 -1
- package/ui/animation/{animation-interfaces.d.ts → animation-shared.d.ts} +39 -31
- package/ui/animation/animation-shared.js +4 -0
- package/ui/animation/animation-shared.js.map +1 -0
- package/ui/animation/animation-types.d.ts +1 -0
- package/ui/animation/animation-types.js +3 -0
- package/ui/animation/animation-types.js.map +1 -0
- package/ui/animation/index.android.d.ts +1 -2
- package/ui/animation/index.android.js +5 -5
- package/ui/animation/index.android.js.map +1 -1
- package/ui/animation/index.d.ts +2 -138
- package/ui/animation/index.ios.d.ts +1 -2
- package/ui/animation/index.ios.js +41 -30
- package/ui/animation/index.ios.js.map +1 -1
- package/ui/animation/keyframe-animation.d.ts +67 -118
- package/ui/animation/keyframe-animation.js +2 -2
- package/ui/animation/keyframe-animation.js.map +1 -1
- package/ui/builder/binding-builder.d.ts +12 -15
- package/ui/builder/component-builder/index.js +5 -5
- package/ui/builder/component-builder/index.js.map +1 -1
- package/ui/builder/index.d.ts +179 -59
- package/ui/builder/index.js +450 -10
- package/ui/builder/index.js.map +1 -1
- package/ui/button/index.android.d.ts +0 -6
- package/ui/button/index.android.js +2 -1
- package/ui/button/index.android.js.map +1 -1
- package/ui/button/index.ios.d.ts +0 -11
- package/ui/core/bindable/bindable-types.d.ts +37 -0
- package/ui/core/bindable/bindable-types.js +3 -0
- package/ui/core/bindable/bindable-types.js.map +1 -0
- package/ui/core/bindable/index.d.ts +2 -38
- package/ui/core/bindable/index.js +1 -2
- package/ui/core/bindable/index.js.map +1 -1
- package/ui/core/properties/index.d.ts +7 -40
- package/ui/core/properties/index.js +6 -35
- package/ui/core/properties/index.js.map +1 -1
- package/ui/core/properties/property-shared.d.ts +35 -0
- package/ui/core/properties/property-shared.js +16 -0
- package/ui/core/properties/property-shared.js.map +1 -0
- package/ui/core/view/index.android.d.ts +13 -47
- package/ui/core/view/index.android.js +117 -119
- package/ui/core/view/index.android.js.map +1 -1
- package/ui/core/view/index.d.ts +1 -61
- package/ui/core/view/index.ios.d.ts +3 -33
- package/ui/core/view/index.ios.js +13 -21
- package/ui/core/view/index.ios.js.map +1 -1
- package/ui/core/view/view-common.d.ts +19 -16
- package/ui/core/view/view-common.js +12 -14
- package/ui/core/view/view-common.js.map +1 -1
- package/ui/core/view/view-helper/index.ios.d.ts +2 -1
- package/ui/core/view/view-helper/index.ios.js +3 -4
- package/ui/core/view/view-helper/index.ios.js.map +1 -1
- package/ui/core/view/view-helper/view-helper-common.js +1 -3
- package/ui/core/view/view-helper/view-helper-common.js.map +1 -1
- package/ui/core/view/view-helper/view-helper-shared.d.ts +5 -0
- package/ui/core/view/view-helper/view-helper-shared.js +6 -0
- package/ui/core/view/view-helper/view-helper-shared.js.map +1 -0
- package/ui/core/view/view-interfaces.d.ts +54 -0
- package/ui/core/view/view-interfaces.js +2 -0
- package/ui/core/view/view-interfaces.js.map +1 -0
- package/ui/core/view-base/index.d.ts +23 -25
- package/ui/core/view-base/index.js +10 -31
- package/ui/core/view-base/index.js.map +1 -1
- package/ui/core/view-base/utils.d.ts +1 -0
- package/ui/core/view-base/utils.js +9 -0
- package/ui/core/view-base/utils.js.map +1 -0
- package/ui/date-picker/index.android.d.ts +0 -6
- package/ui/date-picker/index.ios.d.ts +0 -12
- package/ui/dialogs/dialogs-common.js +3 -3
- package/ui/dialogs/dialogs-common.js.map +1 -1
- package/ui/dialogs/index.android.js +8 -7
- package/ui/dialogs/index.android.js.map +1 -1
- package/ui/dialogs/index.ios.js +2 -2
- package/ui/dialogs/index.ios.js.map +1 -1
- package/ui/editable-text-base/index.android.d.ts +0 -11
- package/ui/editable-text-base/index.ios.d.ts +0 -5
- package/ui/embedding/index.android.d.ts +1 -1
- package/ui/embedding/index.d.ts +1 -1
- package/ui/frame/fragment.android.js +3 -2
- package/ui/frame/fragment.android.js.map +1 -1
- package/ui/frame/fragment.transitions.android.d.ts +3 -0
- package/ui/frame/fragment.transitions.android.js +53 -10
- package/ui/frame/fragment.transitions.android.js.map +1 -1
- package/ui/frame/fragment.transitions.d.ts +9 -1
- package/ui/frame/frame-common.d.ts +4 -3
- package/ui/frame/frame-common.js +4 -1
- package/ui/frame/frame-common.js.map +1 -1
- package/ui/frame/{callbacks/fragment-callbacks.d.ts → frame-helper-for-android.d.ts} +20 -1
- package/ui/frame/{callbacks/fragment-callbacks.js → frame-helper-for-android.js} +52 -38
- package/ui/frame/frame-helper-for-android.js.map +1 -0
- package/ui/frame/frame-interfaces.d.ts +52 -13
- package/ui/frame/frame-interfaces.js.map +1 -1
- package/ui/frame/frame-stack.d.ts +1 -0
- package/ui/frame/frame-stack.js +3 -0
- package/ui/frame/frame-stack.js.map +1 -1
- package/ui/frame/index.android.d.ts +30 -7
- package/ui/frame/index.android.js +357 -81
- package/ui/frame/index.android.js.map +1 -1
- package/ui/frame/index.d.ts +27 -61
- package/ui/frame/index.ios.d.ts +4 -5
- package/ui/frame/index.ios.js +29 -39
- package/ui/frame/index.ios.js.map +1 -1
- package/ui/gestures/gestures-common.d.ts +4 -273
- package/ui/gestures/gestures-common.js +3 -146
- package/ui/gestures/gestures-common.js.map +1 -1
- package/ui/gestures/gestures-types.d.ts +108 -0
- package/ui/gestures/gestures-types.js +40 -0
- package/ui/gestures/gestures-types.js.map +1 -0
- package/ui/gestures/index.android.d.ts +29 -1
- package/ui/gestures/index.android.js +4 -2
- package/ui/gestures/index.android.js.map +1 -1
- package/ui/gestures/index.d.ts +35 -0
- package/ui/gestures/index.ios.d.ts +35 -1
- package/ui/gestures/index.ios.js +3 -3
- package/ui/gestures/index.ios.js.map +1 -1
- package/ui/gestures/touch-manager.d.ts +1 -1
- package/ui/html-view/index.android.d.ts +0 -8
- package/ui/html-view/index.ios.d.ts +0 -5
- package/ui/html-view/index.ios.js +3 -3
- package/ui/html-view/index.ios.js.map +1 -1
- package/ui/image/image-common.js +1 -1
- package/ui/image/image-common.js.map +1 -1
- package/ui/image/index.android.d.ts +0 -4
- package/ui/image/index.android.js +1 -1
- package/ui/image/index.android.js.map +1 -1
- package/ui/image/index.ios.d.ts +2 -2
- package/ui/image/index.ios.js +0 -1
- package/ui/image/index.ios.js.map +1 -1
- package/ui/image-cache/index.ios.js +5 -11
- package/ui/image-cache/index.ios.js.map +1 -1
- package/ui/index.d.ts +10 -5
- package/ui/index.js +18 -3
- package/ui/index.js.map +1 -1
- package/ui/label/index.ios.js.map +1 -1
- package/ui/layouts/absolute-layout/absolute-layout-common.js +1 -1
- package/ui/layouts/absolute-layout/absolute-layout-common.js.map +1 -1
- package/ui/layouts/absolute-layout/index.android.js +1 -1
- package/ui/layouts/absolute-layout/index.android.js.map +1 -1
- package/ui/layouts/absolute-layout/index.d.ts +1 -1
- package/ui/layouts/absolute-layout/index.ios.js.map +1 -1
- package/ui/layouts/dock-layout/index.android.d.ts +0 -1
- package/ui/layouts/flexbox-layout/flexbox-layout-common.js +2 -1
- package/ui/layouts/flexbox-layout/flexbox-layout-common.js.map +1 -1
- package/ui/layouts/flexbox-layout/index.android.d.ts +0 -5
- package/ui/layouts/flexbox-layout/index.android.js +1 -1
- package/ui/layouts/flexbox-layout/index.android.js.map +1 -1
- package/ui/layouts/flexbox-layout/index.ios.js +25 -13
- package/ui/layouts/flexbox-layout/index.ios.js.map +1 -1
- package/ui/layouts/layout-base.android.d.ts +0 -6
- package/ui/layouts/layout-base.android.js +2 -1
- package/ui/layouts/layout-base.android.js.map +1 -1
- package/ui/layouts/layout-base.ios.d.ts +0 -2
- package/ui/layouts/stack-layout/index.ios.js.map +1 -1
- package/ui/layouts/wrap-layout/index.android.js +1 -1
- package/ui/layouts/wrap-layout/index.android.js.map +1 -1
- package/ui/layouts/wrap-layout/index.d.ts +1 -1
- package/ui/layouts/wrap-layout/wrap-layout-common.js +1 -1
- package/ui/layouts/wrap-layout/wrap-layout-common.js.map +1 -1
- package/ui/list-picker/index.android.d.ts +0 -3
- package/ui/list-picker/index.ios.d.ts +0 -3
- package/ui/list-view/index.android.d.ts +0 -5
- package/ui/list-view/index.android.js +1 -1
- package/ui/list-view/index.android.js.map +1 -1
- package/ui/list-view/index.d.ts +1 -1
- package/ui/list-view/index.ios.d.ts +0 -3
- package/ui/list-view/index.ios.js +1 -1
- package/ui/list-view/index.ios.js.map +1 -1
- package/ui/list-view/list-view-common.js +1 -1
- package/ui/list-view/list-view-common.js.map +1 -1
- package/ui/page/events.d.ts +6 -0
- package/ui/page/events.js +7 -0
- package/ui/page/events.js.map +1 -0
- package/ui/page/index.android.d.ts +0 -6
- package/ui/page/index.android.js +2 -1
- package/ui/page/index.android.js.map +1 -1
- package/ui/page/index.d.ts +1 -1
- package/ui/page/index.ios.d.ts +0 -2
- package/ui/page/index.ios.js +65 -99
- package/ui/page/index.ios.js.map +1 -1
- package/ui/page/page-common.d.ts +3 -2
- package/ui/page/page-common.js +5 -4
- package/ui/page/page-common.js.map +1 -1
- package/ui/progress/index.android.d.ts +0 -5
- package/ui/progress/index.ios.d.ts +0 -5
- package/ui/scroll-view/index.android.d.ts +0 -3
- package/ui/scroll-view/index.ios.d.ts +0 -2
- package/ui/scroll-view/index.ios.js +3 -3
- package/ui/scroll-view/index.ios.js.map +1 -1
- package/ui/search-bar/index.android.d.ts +2 -14
- package/ui/search-bar/index.android.js +0 -2
- package/ui/search-bar/index.android.js.map +1 -1
- package/ui/search-bar/index.ios.d.ts +1 -10
- package/ui/search-bar/index.ios.js +0 -2
- package/ui/search-bar/index.ios.js.map +1 -1
- package/ui/segmented-bar/index.android.d.ts +0 -9
- package/ui/segmented-bar/index.ios.d.ts +0 -5
- package/ui/slider/index.android.d.ts +0 -6
- package/ui/slider/index.ios.d.ts +0 -6
- package/ui/styling/background-common.js +0 -1
- package/ui/styling/background-common.js.map +1 -1
- package/ui/styling/background.android.d.ts +0 -6
- package/ui/styling/background.android.js +1 -53
- package/ui/styling/background.android.js.map +1 -1
- package/ui/styling/background.ios.js +2 -1
- package/ui/styling/background.ios.js.map +1 -1
- package/ui/styling/converters.d.ts +2 -2
- package/ui/styling/css-shadow.js.map +1 -1
- package/ui/styling/css-stroke.js.map +1 -1
- package/ui/styling/css-transform.d.ts +1 -1
- package/ui/styling/css-utils.js +1 -1
- package/ui/styling/css-utils.js.map +1 -1
- package/ui/styling/font.android.js +2 -2
- package/ui/styling/font.android.js.map +1 -1
- package/ui/styling/font.ios.js +10 -10
- package/ui/styling/font.ios.js.map +1 -1
- package/ui/styling/length-shared.d.ts +52 -0
- package/ui/styling/length-shared.js +173 -0
- package/ui/styling/length-shared.js.map +1 -0
- package/ui/styling/style/index.d.ts +1 -1
- package/ui/styling/style-properties.d.ts +58 -113
- package/ui/styling/style-properties.js +7 -93
- package/ui/styling/style-properties.js.map +1 -1
- package/ui/styling/style-scope.d.ts +85 -48
- package/ui/styling/style-scope.js +30 -36
- package/ui/styling/style-scope.js.map +1 -1
- package/ui/styling/styling-profile.d.ts +1 -0
- package/ui/styling/styling-profile.js +4 -0
- package/ui/styling/styling-profile.js.map +1 -0
- package/ui/styling/styling-shared.d.ts +3 -0
- package/ui/styling/styling-shared.js +6 -0
- package/ui/styling/styling-shared.js.map +1 -0
- package/ui/switch/index.android.d.ts +0 -5
- package/ui/switch/index.ios.d.ts +0 -6
- package/ui/switch/index.ios.js +4 -17
- package/ui/switch/index.ios.js.map +1 -1
- package/ui/tab-view/index.android.d.ts +0 -16
- package/ui/tab-view/index.android.js +6 -6
- package/ui/tab-view/index.android.js.map +1 -1
- package/ui/tab-view/index.ios.d.ts +0 -10
- package/ui/tab-view/index.ios.js +1 -4
- package/ui/tab-view/index.ios.js.map +1 -1
- package/ui/text-base/index.android.d.ts +6 -29
- package/ui/text-base/index.android.js +16 -20
- package/ui/text-base/index.android.js.map +1 -1
- package/ui/text-base/index.d.ts +1 -1
- package/ui/text-base/index.ios.d.ts +0 -16
- package/ui/text-base/index.ios.js +5 -4
- package/ui/text-base/index.ios.js.map +1 -1
- package/ui/text-field/index.ios.d.ts +0 -13
- package/ui/text-field/index.ios.js +1 -1
- package/ui/text-field/index.ios.js.map +1 -1
- package/ui/text-view/index.ios.d.ts +0 -15
- package/ui/text-view/index.ios.js.map +1 -1
- package/ui/time-picker/index.ios.d.ts +0 -9
- package/ui/transition/fade-transition.ios.js +1 -1
- package/ui/transition/fade-transition.ios.js.map +1 -1
- package/ui/transition/index.ios.js +1 -1
- package/ui/transition/index.ios.js.map +1 -1
- package/ui/transition/modal-transition.ios.js +1 -1
- package/ui/transition/modal-transition.ios.js.map +1 -1
- package/ui/transition/page-transition.android.d.ts +1 -1
- package/ui/transition/page-transition.android.js +4 -4
- package/ui/transition/page-transition.android.js.map +1 -1
- package/ui/transition/page-transition.ios.js +1 -1
- package/ui/transition/page-transition.ios.js.map +1 -1
- package/ui/transition/shared-transition-helper.ios.js +1 -1
- package/ui/transition/shared-transition-helper.ios.js.map +1 -1
- package/ui/transition/shared-transition.js +2 -1
- package/ui/transition/shared-transition.js.map +1 -1
- package/ui/transition/slide-transition.ios.js +2 -2
- package/ui/transition/slide-transition.ios.js.map +1 -1
- package/ui/web-view/web-view-common.d.ts +0 -1
- package/utils/animation-helpers.d.ts +27 -0
- package/utils/animation-helpers.js +48 -0
- package/utils/animation-helpers.js.map +1 -0
- package/utils/common.d.ts +1 -38
- package/utils/common.js +2 -112
- package/utils/common.js.map +1 -1
- package/utils/debug-source.d.ts +19 -0
- package/utils/debug-source.js +78 -0
- package/utils/debug-source.js.map +1 -0
- package/utils/debug.js +1 -59
- package/utils/debug.js.map +1 -1
- package/utils/index.android.d.ts +3 -1
- package/utils/index.android.js +37 -11
- package/utils/index.android.js.map +1 -1
- package/utils/index.d.ts +2 -14
- package/utils/index.ios.d.ts +4 -1
- package/utils/index.ios.js +32 -5
- package/utils/index.ios.js.map +1 -1
- package/utils/layout-helper/index.android.js +4 -4
- package/utils/layout-helper/index.android.js.map +1 -1
- package/utils/layout-helper/index.d.ts +6 -4
- package/utils/layout-helper/index.ios.js +5 -5
- package/utils/layout-helper/index.ios.js.map +1 -1
- package/utils/layout-helper/layout-helper-common.d.ts +0 -9
- package/utils/layout-helper/layout-helper-common.js +1 -9
- package/utils/layout-helper/layout-helper-common.js.map +1 -1
- package/utils/layout-helper/layout-helper-shared.d.ts +9 -0
- package/utils/layout-helper/layout-helper-shared.js +13 -0
- package/utils/layout-helper/layout-helper-shared.js.map +1 -0
- package/utils/{android/index.d.ts → native-helper-for-android.d.ts} +4 -2
- package/utils/native-helper-for-android.js +273 -0
- package/utils/native-helper-for-android.js.map +1 -0
- package/utils/native-helper.android.d.ts +29 -5
- package/utils/native-helper.android.js +18 -131
- package/utils/native-helper.android.js.map +1 -1
- package/utils/native-helper.d.ts +206 -258
- package/utils/native-helper.ios.d.ts +72 -3
- package/utils/native-helper.ios.js +250 -3
- package/utils/native-helper.ios.js.map +1 -1
- package/utils/shared.d.ts +17 -0
- package/utils/shared.js +40 -0
- package/utils/shared.js.map +1 -0
- package/utils/utils-shared.d.ts +1 -0
- package/utils/utils-shared.js +8 -0
- package/utils/utils-shared.js.map +1 -0
- package/xhr/index.js +12 -13
- package/xhr/index.js.map +1 -1
- package/xml/index.d.ts +94 -98
- package/xml/index.js +58 -2
- package/xml/index.js.map +1 -1
- package/accessibility/accessibility-css-helper.d.ts +0 -1
- package/accessibility/accessibility-css-helper.js +0 -101
- package/accessibility/accessibility-css-helper.js.map +0 -1
- package/accessibility/accessibility-service-common.d.ts +0 -8
- package/accessibility/accessibility-service-common.js +0 -26
- package/accessibility/accessibility-service-common.js.map +0 -1
- package/accessibility/accessibility-service.android.d.ts +0 -6
- package/accessibility/accessibility-service.android.js +0 -103
- package/accessibility/accessibility-service.android.js.map +0 -1
- package/accessibility/accessibility-service.d.ts +0 -10
- package/accessibility/accessibility-service.ios.d.ts +0 -6
- package/accessibility/accessibility-service.ios.js +0 -61
- package/accessibility/accessibility-service.ios.js.map +0 -1
- package/accessibility/accessibility-types.d.ts +0 -224
- package/accessibility/accessibility-types.js +0 -222
- package/accessibility/accessibility-types.js.map +0 -1
- package/accessibility/font-scale-common.d.ts +0 -7
- package/accessibility/font-scale-common.js +0 -14
- package/accessibility/font-scale-common.js.map +0 -1
- package/accessibility/font-scale.android.d.ts +0 -5
- package/accessibility/font-scale.android.js +0 -55
- package/accessibility/font-scale.android.js.map +0 -1
- package/accessibility/font-scale.d.ts +0 -9
- package/accessibility/font-scale.ios.d.ts +0 -5
- package/accessibility/font-scale.ios.js +0 -89
- package/accessibility/font-scale.ios.js.map +0 -1
- package/accessibility/index.android.d.ts +0 -10
- package/accessibility/index.android.js +0 -577
- package/accessibility/index.android.js.map +0 -1
- package/accessibility/index.ios.d.ts +0 -9
- package/accessibility/index.ios.js +0 -229
- package/accessibility/index.ios.js.map +0 -1
- package/cli-hooks/postinstall.js +0 -2
- package/cli-hooks/preuninstall.js +0 -2
- package/css/package.json +0 -36
- package/css-value/package.json +0 -23
- package/debugger/dom-node.d.ts +0 -27
- package/debugger/dom-node.js.map +0 -1
- package/ui/animation/animation-interfaces.js.map +0 -1
- package/ui/builder/xml2ui.d.ts +0 -134
- package/ui/builder/xml2ui.js +0 -397
- package/ui/builder/xml2ui.js.map +0 -1
- package/ui/frame/callbacks/activity-callbacks.d.ts +0 -19
- package/ui/frame/callbacks/activity-callbacks.js +0 -301
- package/ui/frame/callbacks/activity-callbacks.js.map +0 -1
- package/ui/frame/callbacks/fragment-callbacks.js.map +0 -1
- package/utils/android/index.js +0 -160
- package/utils/android/index.js.map +0 -1
- package/utils/ios/index.d.ts +0 -39
- package/utils/ios/index.js +0 -229
- package/utils/ios/index.js.map +0 -1
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
// Types.
|
|
2
|
-
import { Application } from '../../application';
|
|
3
1
|
import { Observable } from '../../data/observable';
|
|
4
2
|
import { Trace } from '../../trace';
|
|
5
3
|
import { _stack, FrameBase, NavigationType } from './frame-common';
|
|
6
|
-
import { _clearEntry, _clearFragment, _getAnimatedEntries, _reverseTransitions, _setAndroidFragmentTransitions, _updateTransitions
|
|
4
|
+
import { _clearEntry, _clearFragment, _getAnimatedEntries, _getTransitionState, _restoreTransitionState, _reverseTransitions, _setAndroidFragmentTransitions, _updateTransitions } from './fragment.transitions';
|
|
7
5
|
import { profile } from '../../profiling';
|
|
8
6
|
import { android as androidUtils } from '../../utils/native-helper';
|
|
9
7
|
import { ensureFragmentClass, fragmentClass } from './fragment';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
8
|
+
import { getAppMainEntry } from '../../application/helpers-common';
|
|
9
|
+
import { Application } from '../../application/application';
|
|
10
|
+
import { isEmbedded, setEmbeddedView } from '../embedding';
|
|
11
|
+
import { CALLBACKS, FRAMEID, framesCache, setFragmentCallbacks } from './frame-helper-for-android';
|
|
12
12
|
export * from './frame-common';
|
|
13
13
|
export { setFragmentClass } from './fragment';
|
|
14
14
|
const INTENT_EXTRA = 'com.tns.activity';
|
|
15
|
-
const FRAMEID = '_frameId';
|
|
16
|
-
const CALLBACKS = '_callbacks';
|
|
17
15
|
const ownerSymbol = Symbol('_owner');
|
|
16
|
+
const isPendingDetachSymbol = Symbol('_isPendingDetach');
|
|
18
17
|
let navDepth = -1;
|
|
19
18
|
let fragmentId = -1;
|
|
20
|
-
export { moduleLoaded } from './callbacks/activity-callbacks';
|
|
21
19
|
export let attachStateChangeListener;
|
|
22
20
|
function getAttachListener() {
|
|
23
21
|
if (!attachStateChangeListener) {
|
|
@@ -41,6 +39,11 @@ function getAttachListener() {
|
|
|
41
39
|
if (owner) {
|
|
42
40
|
owner._onDetachedFromWindow();
|
|
43
41
|
}
|
|
42
|
+
if (view[isPendingDetachSymbol]) {
|
|
43
|
+
delete view[isPendingDetachSymbol];
|
|
44
|
+
view.removeOnAttachStateChangeListener(this);
|
|
45
|
+
view[ownerSymbol] = null;
|
|
46
|
+
}
|
|
44
47
|
},
|
|
45
48
|
});
|
|
46
49
|
attachStateChangeListener = new AttachListener();
|
|
@@ -53,7 +56,10 @@ export class Frame extends FrameBase {
|
|
|
53
56
|
this._containerViewId = -1;
|
|
54
57
|
this._tearDownPending = false;
|
|
55
58
|
this._attachedToWindow = false;
|
|
56
|
-
|
|
59
|
+
/**
|
|
60
|
+
* This property indicates that the view is to be reused as a root view or has been previously disposed.
|
|
61
|
+
*/
|
|
62
|
+
this._isReset = false;
|
|
57
63
|
this._android = new AndroidFrame(this);
|
|
58
64
|
}
|
|
59
65
|
static reloadPage(context) {
|
|
@@ -62,7 +68,7 @@ export class Frame extends FrameBase {
|
|
|
62
68
|
if (callbacks) {
|
|
63
69
|
const rootView = callbacks.getRootView();
|
|
64
70
|
// Handle application root module
|
|
65
|
-
const isAppRootModuleChanged = context && context.path && context.path.includes(
|
|
71
|
+
const isAppRootModuleChanged = context && context.path && context.path.includes(getAppMainEntry().moduleName) && context.type !== 'style';
|
|
66
72
|
// Reset activity content when:
|
|
67
73
|
// + Application root module is changed
|
|
68
74
|
// + View did not handle the change
|
|
@@ -109,8 +115,9 @@ export class Frame extends FrameBase {
|
|
|
109
115
|
return;
|
|
110
116
|
}
|
|
111
117
|
this._attachedToWindow = true;
|
|
112
|
-
this.
|
|
118
|
+
this._isReset = false;
|
|
113
119
|
this._processNextNavigationEntry();
|
|
120
|
+
this._ensureEntryFragment();
|
|
114
121
|
}
|
|
115
122
|
_onDetachedFromWindow() {
|
|
116
123
|
super._onDetachedFromWindow();
|
|
@@ -125,12 +132,12 @@ export class Frame extends FrameBase {
|
|
|
125
132
|
if (!this.isLoaded || this._executingContext) {
|
|
126
133
|
return;
|
|
127
134
|
}
|
|
128
|
-
// in case the activity is "reset" using resetRootView we must wait for
|
|
135
|
+
// in case the activity is "reset" using resetRootView or disposed we must wait for
|
|
129
136
|
// the attachedToWindow event to make the first navigation or it will crash
|
|
130
137
|
// https://github.com/NativeScript/NativeScript/commit/9dd3e1a8076e5022e411f2f2eeba34aabc68d112
|
|
131
138
|
// though we should not do it on app "start"
|
|
132
139
|
// or it will create a "flash" to activity background color
|
|
133
|
-
if (this.
|
|
140
|
+
if (this._isReset && !this._attachedToWindow) {
|
|
134
141
|
return;
|
|
135
142
|
}
|
|
136
143
|
const animatedEntries = _getAnimatedEntries(this._android.frameId);
|
|
@@ -154,7 +161,7 @@ export class Frame extends FrameBase {
|
|
|
154
161
|
// simulated navigation (NoTransition, zero duration animator) and thus the fragment immediately disappears;
|
|
155
162
|
// the user only sees the animation of the entering fragment as per its specific enter animation settings.
|
|
156
163
|
// NOTE: we are restoring the animation settings in Frame.setCurrent(...) as navigation completes asynchronously
|
|
157
|
-
const cachedTransitionState =
|
|
164
|
+
const cachedTransitionState = _getTransitionState(this._currentEntry);
|
|
158
165
|
if (cachedTransitionState) {
|
|
159
166
|
this._cachedTransitionState = cachedTransitionState;
|
|
160
167
|
this._currentEntry = null;
|
|
@@ -186,7 +193,7 @@ export class Frame extends FrameBase {
|
|
|
186
193
|
_onRootViewReset() {
|
|
187
194
|
super._onRootViewReset();
|
|
188
195
|
// used to handle the "first" navigate differently on first run and on reset
|
|
189
|
-
this.
|
|
196
|
+
this._isReset = true;
|
|
190
197
|
// call this AFTER the super call to ensure descendants apply their rootview-reset logic first
|
|
191
198
|
// i.e. in a scenario with nested frames / frame with tabview let the descendandt cleanup the inner
|
|
192
199
|
// fragments first, and then cleanup the parent fragments
|
|
@@ -198,6 +205,28 @@ export class Frame extends FrameBase {
|
|
|
198
205
|
this.backgroundColor = this._originalBackground;
|
|
199
206
|
this._originalBackground = null;
|
|
200
207
|
}
|
|
208
|
+
this._ensureEntryFragment();
|
|
209
|
+
super.onLoaded();
|
|
210
|
+
}
|
|
211
|
+
onUnloaded() {
|
|
212
|
+
super.onUnloaded();
|
|
213
|
+
if (typeof this._frameCreateTimeout === 'number') {
|
|
214
|
+
clearTimeout(this._frameCreateTimeout);
|
|
215
|
+
this._frameCreateTimeout = null;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* TODO: Check if this fragment precaution is still needed
|
|
220
|
+
*/
|
|
221
|
+
_ensureEntryFragment() {
|
|
222
|
+
// in case the activity is "reset" using resetRootView or disposed we must wait for
|
|
223
|
+
// the attachedToWindow event to make the first navigation or it will crash
|
|
224
|
+
// https://github.com/NativeScript/NativeScript/commit/9dd3e1a8076e5022e411f2f2eeba34aabc68d112
|
|
225
|
+
// though we should not do it on app "start"
|
|
226
|
+
// or it will create a "flash" to activity background color
|
|
227
|
+
if (this._isReset && !this._attachedToWindow) {
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
201
230
|
this._frameCreateTimeout = setTimeout(() => {
|
|
202
231
|
// there's a bug with nested frames where sometimes the nested fragment is not recreated at all
|
|
203
232
|
// so we manually check on loaded event if the fragment is not recreated and recreate it
|
|
@@ -212,15 +241,8 @@ export class Frame extends FrameBase {
|
|
|
212
241
|
transaction.commitAllowingStateLoss();
|
|
213
242
|
}
|
|
214
243
|
}
|
|
215
|
-
}, 0);
|
|
216
|
-
super.onLoaded();
|
|
217
|
-
}
|
|
218
|
-
onUnloaded() {
|
|
219
|
-
super.onUnloaded();
|
|
220
|
-
if (typeof this._frameCreateTimeout === 'number') {
|
|
221
|
-
clearTimeout(this._frameCreateTimeout);
|
|
222
244
|
this._frameCreateTimeout = null;
|
|
223
|
-
}
|
|
245
|
+
}, 0);
|
|
224
246
|
}
|
|
225
247
|
disposeCurrentFragment() {
|
|
226
248
|
if (!this._currentEntry || !this._currentEntry.fragment || !this._currentEntry.fragment.isAdded()) {
|
|
@@ -291,7 +313,7 @@ export class Frame extends FrameBase {
|
|
|
291
313
|
}
|
|
292
314
|
// restore cached animation settings if we just completed simulated first navigation (no animation)
|
|
293
315
|
if (this._cachedTransitionState) {
|
|
294
|
-
|
|
316
|
+
_restoreTransitionState(this._cachedTransitionState);
|
|
295
317
|
this._cachedTransitionState = null;
|
|
296
318
|
}
|
|
297
319
|
// restore original fragment transitions if we just completed replace navigation (hmr)
|
|
@@ -396,16 +418,16 @@ export class Frame extends FrameBase {
|
|
|
396
418
|
super._removeEntry(removed);
|
|
397
419
|
if (removed.fragment) {
|
|
398
420
|
_clearEntry(removed);
|
|
421
|
+
removed.fragment = null;
|
|
399
422
|
}
|
|
400
|
-
removed.fragment = null;
|
|
401
423
|
removed.viewSavedState = null;
|
|
402
424
|
}
|
|
403
425
|
_disposeBackstackEntry(entry) {
|
|
404
426
|
if (entry.fragment) {
|
|
405
427
|
_clearFragment(entry);
|
|
428
|
+
entry.fragment = null;
|
|
406
429
|
}
|
|
407
430
|
entry.recreated = false;
|
|
408
|
-
entry.fragment = null;
|
|
409
431
|
super._disposeBackstackEntry(entry);
|
|
410
432
|
}
|
|
411
433
|
createNativeView() {
|
|
@@ -420,18 +442,27 @@ export class Frame extends FrameBase {
|
|
|
420
442
|
initNativeView() {
|
|
421
443
|
super.initNativeView();
|
|
422
444
|
const listener = getAttachListener();
|
|
423
|
-
this.nativeViewProtected
|
|
424
|
-
|
|
425
|
-
|
|
445
|
+
const nativeView = this.nativeViewProtected;
|
|
446
|
+
nativeView.addOnAttachStateChangeListener(listener);
|
|
447
|
+
nativeView[ownerSymbol] = this;
|
|
448
|
+
this._android.rootViewGroup = nativeView;
|
|
426
449
|
if (this._containerViewId < 0) {
|
|
427
450
|
this._containerViewId = android.view.View.generateViewId();
|
|
428
451
|
}
|
|
429
452
|
this._android.rootViewGroup.setId(this._containerViewId);
|
|
430
453
|
}
|
|
431
454
|
disposeNativeView() {
|
|
455
|
+
const nativeView = this.nativeViewProtected;
|
|
432
456
|
const listener = getAttachListener();
|
|
433
|
-
|
|
434
|
-
|
|
457
|
+
// There are cases like root view when detach listener is not called upon removing view from view-tree
|
|
458
|
+
// so mark those views as pending and remove listener once the view is detached
|
|
459
|
+
if (nativeView.isAttachedToWindow()) {
|
|
460
|
+
nativeView[isPendingDetachSymbol] = true;
|
|
461
|
+
}
|
|
462
|
+
else {
|
|
463
|
+
nativeView.removeOnAttachStateChangeListener(listener);
|
|
464
|
+
nativeView[ownerSymbol] = null;
|
|
465
|
+
}
|
|
435
466
|
this._tearDownPending = !!this._executingContext;
|
|
436
467
|
const current = this._currentEntry;
|
|
437
468
|
const executingEntry = this._executingContext ? this._executingContext.entry : null;
|
|
@@ -445,6 +476,10 @@ export class Frame extends FrameBase {
|
|
|
445
476
|
if (current && !executingEntry) {
|
|
446
477
|
this._disposeBackstackEntry(current);
|
|
447
478
|
}
|
|
479
|
+
// Dispose cached transition and store it again if view ever gets re-used
|
|
480
|
+
this._cachedTransitionState = null;
|
|
481
|
+
// Mark as reset in order to properly re-initialize fragments if view ever gets re-used
|
|
482
|
+
this._isReset = true;
|
|
448
483
|
this._android.rootViewGroup = null;
|
|
449
484
|
this._removeFromFrameStack();
|
|
450
485
|
super.disposeNativeView();
|
|
@@ -496,47 +531,7 @@ export function reloadPage(context) {
|
|
|
496
531
|
}
|
|
497
532
|
// attach on global, so it can be overwritten in NativeScript Angular
|
|
498
533
|
global.__onLiveSyncCore = Frame.reloadPage;
|
|
499
|
-
function cloneExpandedTransitionListener(expandedTransitionListener) {
|
|
500
|
-
if (!expandedTransitionListener) {
|
|
501
|
-
return null;
|
|
502
|
-
}
|
|
503
|
-
const cloneTransition = expandedTransitionListener.transition.clone();
|
|
504
|
-
return addNativeTransitionListener(expandedTransitionListener.entry, cloneTransition);
|
|
505
|
-
}
|
|
506
|
-
function getTransitionState(entry) {
|
|
507
|
-
const expandedEntry = entry;
|
|
508
|
-
const transitionState = {};
|
|
509
|
-
if (expandedEntry.enterTransitionListener && expandedEntry.exitTransitionListener) {
|
|
510
|
-
transitionState.enterTransitionListener = cloneExpandedTransitionListener(expandedEntry.enterTransitionListener);
|
|
511
|
-
transitionState.exitTransitionListener = cloneExpandedTransitionListener(expandedEntry.exitTransitionListener);
|
|
512
|
-
transitionState.reenterTransitionListener = cloneExpandedTransitionListener(expandedEntry.reenterTransitionListener);
|
|
513
|
-
transitionState.returnTransitionListener = cloneExpandedTransitionListener(expandedEntry.returnTransitionListener);
|
|
514
|
-
transitionState.transitionName = expandedEntry.transitionName;
|
|
515
|
-
transitionState.entry = entry;
|
|
516
|
-
}
|
|
517
|
-
else {
|
|
518
|
-
return null;
|
|
519
|
-
}
|
|
520
|
-
return transitionState;
|
|
521
|
-
}
|
|
522
|
-
function restoreTransitionState(entry, snapshot) {
|
|
523
|
-
const expandedEntry = entry;
|
|
524
|
-
if (snapshot.enterTransitionListener) {
|
|
525
|
-
expandedEntry.enterTransitionListener = snapshot.enterTransitionListener;
|
|
526
|
-
}
|
|
527
|
-
if (snapshot.exitTransitionListener) {
|
|
528
|
-
expandedEntry.exitTransitionListener = snapshot.exitTransitionListener;
|
|
529
|
-
}
|
|
530
|
-
if (snapshot.reenterTransitionListener) {
|
|
531
|
-
expandedEntry.reenterTransitionListener = snapshot.reenterTransitionListener;
|
|
532
|
-
}
|
|
533
|
-
if (snapshot.returnTransitionListener) {
|
|
534
|
-
expandedEntry.returnTransitionListener = snapshot.returnTransitionListener;
|
|
535
|
-
}
|
|
536
|
-
expandedEntry.transitionName = snapshot.transitionName;
|
|
537
|
-
}
|
|
538
534
|
let framesCounter = 0;
|
|
539
|
-
const framesCache = new Array();
|
|
540
535
|
class AndroidFrame extends Observable {
|
|
541
536
|
constructor(owner) {
|
|
542
537
|
super();
|
|
@@ -622,20 +617,301 @@ function startActivity(activity, frameId) {
|
|
|
622
617
|
// TODO: Put the navigation context (if any) in the intent
|
|
623
618
|
activity.startActivity(intent);
|
|
624
619
|
}
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
620
|
+
const activityRootViewsMap = new Map();
|
|
621
|
+
const ROOT_VIEW_ID_EXTRA = 'com.tns.activity.rootViewId';
|
|
622
|
+
export let moduleLoaded;
|
|
623
|
+
export class ActivityCallbacksImplementation {
|
|
624
|
+
getRootView() {
|
|
625
|
+
return this._rootView;
|
|
626
|
+
}
|
|
627
|
+
onCreate(activity, savedInstanceState, intentOrSuperFunc, superFunc) {
|
|
628
|
+
if (Trace.isEnabled()) {
|
|
629
|
+
Trace.write(`Activity.onCreate(${savedInstanceState})`, Trace.categories.NativeLifecycle);
|
|
630
|
+
}
|
|
631
|
+
const intent = superFunc ? intentOrSuperFunc : undefined;
|
|
632
|
+
if (!superFunc) {
|
|
633
|
+
console.log('AndroidActivityCallbacks.onCreate(activity: any, savedInstanceState: any, superFunc: Function) ' + 'is deprecated. Use AndroidActivityCallbacks.onCreate(activity: any, savedInstanceState: any, intent: any, superFunc: Function) instead.');
|
|
634
|
+
superFunc = intentOrSuperFunc;
|
|
635
|
+
}
|
|
636
|
+
// If there is savedInstanceState this call will recreate all fragments that were previously in the navigation.
|
|
637
|
+
// We take care of associating them with a Page from our backstack in the onAttachFragment callback.
|
|
638
|
+
// If there is savedInstanceState and moduleLoaded is false we are restarted but process was killed.
|
|
639
|
+
// For now we treat it like first run (e.g. we are not passing savedInstanceState so no fragments are being restored).
|
|
640
|
+
// When we add support for application save/load state - revise this logic.
|
|
641
|
+
const isRestart = !!savedInstanceState && moduleLoaded;
|
|
642
|
+
superFunc.call(activity, isRestart ? savedInstanceState : null);
|
|
643
|
+
// Try to get the rootViewId form the saved state in case the activity
|
|
644
|
+
// was destroyed and we are now recreating it.
|
|
645
|
+
if (savedInstanceState) {
|
|
646
|
+
const rootViewId = savedInstanceState.getInt(ROOT_VIEW_ID_EXTRA, -1);
|
|
647
|
+
if (rootViewId !== -1 && activityRootViewsMap.has(rootViewId)) {
|
|
648
|
+
this._rootView = activityRootViewsMap.get(rootViewId)?.get();
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
if (intent && intent.getAction()) {
|
|
652
|
+
Application.android.notify({
|
|
653
|
+
eventName: Application.AndroidApplication.activityNewIntentEvent,
|
|
654
|
+
object: Application.android,
|
|
655
|
+
activity,
|
|
656
|
+
intent,
|
|
657
|
+
});
|
|
658
|
+
}
|
|
659
|
+
this.setActivityContent(activity, savedInstanceState, true);
|
|
660
|
+
moduleLoaded = true;
|
|
661
|
+
}
|
|
662
|
+
onSaveInstanceState(activity, outState, superFunc) {
|
|
663
|
+
superFunc.call(activity, outState);
|
|
664
|
+
const rootView = this._rootView;
|
|
665
|
+
if (rootView instanceof Frame) {
|
|
666
|
+
outState.putInt(INTENT_EXTRA, rootView.android.frameId);
|
|
667
|
+
rootView._saveFragmentsState();
|
|
668
|
+
}
|
|
669
|
+
if (rootView) {
|
|
670
|
+
outState.putInt(ROOT_VIEW_ID_EXTRA, rootView._domId);
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
onNewIntent(activity, intent, superSetIntentFunc, superFunc) {
|
|
674
|
+
superFunc.call(activity, intent);
|
|
675
|
+
superSetIntentFunc.call(activity, intent);
|
|
676
|
+
Application.android.notify({
|
|
677
|
+
eventName: Application.AndroidApplication.activityNewIntentEvent,
|
|
678
|
+
object: Application.android,
|
|
679
|
+
activity,
|
|
680
|
+
intent,
|
|
681
|
+
});
|
|
682
|
+
}
|
|
683
|
+
onStart(activity, superFunc) {
|
|
684
|
+
superFunc.call(activity);
|
|
685
|
+
if (Trace.isEnabled()) {
|
|
686
|
+
Trace.write('NativeScriptActivity.onStart();', Trace.categories.NativeLifecycle);
|
|
687
|
+
}
|
|
688
|
+
const rootView = this._rootView;
|
|
689
|
+
if (rootView && !rootView.isLoaded && !isEmbedded()) {
|
|
690
|
+
rootView.callLoaded();
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
onStop(activity, superFunc) {
|
|
694
|
+
superFunc.call(activity);
|
|
695
|
+
if (Trace.isEnabled()) {
|
|
696
|
+
Trace.write('NativeScriptActivity.onStop();', Trace.categories.NativeLifecycle);
|
|
697
|
+
}
|
|
698
|
+
const rootView = this._rootView;
|
|
699
|
+
if (rootView && rootView.isLoaded && !isEmbedded()) {
|
|
700
|
+
rootView.callUnloaded();
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
onPostResume(activity, superFunc) {
|
|
704
|
+
superFunc.call(activity);
|
|
705
|
+
if (Trace.isEnabled()) {
|
|
706
|
+
Trace.write('NativeScriptActivity.onPostResume();', Trace.categories.NativeLifecycle);
|
|
707
|
+
}
|
|
708
|
+
// NOTE: activity.onPostResume() is called when activity resume is complete and we can
|
|
709
|
+
// safely raise the application resume event;
|
|
710
|
+
// onActivityResumed(...) lifecycle callback registered in application is called too early
|
|
711
|
+
// and raising the application resume event there causes issues like
|
|
712
|
+
// https://github.com/NativeScript/NativeScript/issues/6708
|
|
713
|
+
if (activity.isNativeScriptActivity) {
|
|
714
|
+
Application.setSuspended(false, {
|
|
715
|
+
// todo: deprecate in favor of using event.activity instead.
|
|
716
|
+
android: activity,
|
|
717
|
+
activity,
|
|
718
|
+
});
|
|
631
719
|
}
|
|
632
720
|
}
|
|
633
|
-
|
|
721
|
+
onDestroy(activity, superFunc) {
|
|
722
|
+
try {
|
|
723
|
+
if (Trace.isEnabled()) {
|
|
724
|
+
Trace.write('NativeScriptActivity.onDestroy();', Trace.categories.NativeLifecycle);
|
|
725
|
+
}
|
|
726
|
+
const rootView = this._rootView;
|
|
727
|
+
if (rootView) {
|
|
728
|
+
rootView._tearDownUI(true);
|
|
729
|
+
}
|
|
730
|
+
// this may happen when the user changes the system theme
|
|
731
|
+
// In such case, isFinishing() is false (and isChangingConfigurations is true), and the app will start again (onCreate) with a savedInstanceState
|
|
732
|
+
// as a result, launchEvent will never be called
|
|
733
|
+
// possible alternative: always fire launchEvent and exitEvent, but pass extra flags to make it clear what kind of launch/destroy is happening
|
|
734
|
+
if (activity.isFinishing()) {
|
|
735
|
+
const exitArgs = {
|
|
736
|
+
eventName: Application.exitEvent,
|
|
737
|
+
object: Application.android,
|
|
738
|
+
android: activity,
|
|
739
|
+
};
|
|
740
|
+
Application.notify(exitArgs);
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
finally {
|
|
744
|
+
superFunc.call(activity);
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
onBackPressed(activity, superFunc) {
|
|
748
|
+
if (Trace.isEnabled()) {
|
|
749
|
+
Trace.write('NativeScriptActivity.onBackPressed;', Trace.categories.NativeLifecycle);
|
|
750
|
+
}
|
|
751
|
+
const args = {
|
|
752
|
+
eventName: 'activityBackPressed',
|
|
753
|
+
object: Application,
|
|
754
|
+
android: Application.android,
|
|
755
|
+
activity: activity,
|
|
756
|
+
cancel: false,
|
|
757
|
+
};
|
|
758
|
+
Application.android.notify(args);
|
|
759
|
+
if (args.cancel) {
|
|
760
|
+
return;
|
|
761
|
+
}
|
|
762
|
+
const view = this._rootView;
|
|
763
|
+
let callSuper = false;
|
|
764
|
+
const viewArgs = {
|
|
765
|
+
eventName: 'activityBackPressed',
|
|
766
|
+
object: view,
|
|
767
|
+
activity: activity,
|
|
768
|
+
cancel: false,
|
|
769
|
+
};
|
|
770
|
+
view.notify(viewArgs);
|
|
771
|
+
// In the case of Frame, use this callback only if it was overridden, since the original will cause navigation issues
|
|
772
|
+
if (!viewArgs.cancel && (view.onBackPressed === Frame.prototype.onBackPressed || !view.onBackPressed())) {
|
|
773
|
+
callSuper = view instanceof Frame ? !Frame.goBack() : true;
|
|
774
|
+
}
|
|
775
|
+
if (callSuper) {
|
|
776
|
+
superFunc.call(activity);
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
onRequestPermissionsResult(activity, requestCode, permissions, grantResults, superFunc) {
|
|
780
|
+
if (Trace.isEnabled()) {
|
|
781
|
+
Trace.write('NativeScriptActivity.onRequestPermissionsResult;', Trace.categories.NativeLifecycle);
|
|
782
|
+
}
|
|
783
|
+
Application.android.notify({
|
|
784
|
+
eventName: 'activityRequestPermissions',
|
|
785
|
+
object: Application,
|
|
786
|
+
android: Application.android,
|
|
787
|
+
activity: activity,
|
|
788
|
+
requestCode: requestCode,
|
|
789
|
+
permissions: permissions,
|
|
790
|
+
grantResults: grantResults,
|
|
791
|
+
});
|
|
792
|
+
}
|
|
793
|
+
onActivityResult(activity, requestCode, resultCode, data, superFunc) {
|
|
794
|
+
superFunc.call(activity, requestCode, resultCode, data);
|
|
795
|
+
if (Trace.isEnabled()) {
|
|
796
|
+
Trace.write(`NativeScriptActivity.onActivityResult(${requestCode}, ${resultCode}, ${data})`, Trace.categories.NativeLifecycle);
|
|
797
|
+
}
|
|
798
|
+
Application.android.notify({
|
|
799
|
+
eventName: 'activityResult',
|
|
800
|
+
object: Application,
|
|
801
|
+
android: Application.android,
|
|
802
|
+
activity: activity,
|
|
803
|
+
requestCode: requestCode,
|
|
804
|
+
resultCode: resultCode,
|
|
805
|
+
intent: data,
|
|
806
|
+
});
|
|
807
|
+
}
|
|
808
|
+
resetActivityContent(activity) {
|
|
809
|
+
if (this._rootView) {
|
|
810
|
+
const manager = this._rootView._getFragmentManager();
|
|
811
|
+
manager.executePendingTransactions();
|
|
812
|
+
this._rootView._onRootViewReset();
|
|
813
|
+
}
|
|
814
|
+
// Delete previously cached root view in order to recreate it.
|
|
815
|
+
this._rootView = null;
|
|
816
|
+
this.setActivityContent(activity, null, false);
|
|
817
|
+
this._rootView.callLoaded();
|
|
818
|
+
}
|
|
819
|
+
// Paths that go trough this method:
|
|
820
|
+
// 1. Application initial start - there is no rootView in callbacks.
|
|
821
|
+
// 2. Application revived after Activity is destroyed. this._rootView should have been restored by id in onCreate.
|
|
822
|
+
// 3. Livesync if rootView has no custom _onLivesync. this._rootView should have been cleared upfront. Launch event should not fired
|
|
823
|
+
// 4. resetRootView method. this._rootView should have been cleared upfront. Launch event should not fired
|
|
824
|
+
setActivityContent(activity, savedInstanceState, fireLaunchEvent) {
|
|
825
|
+
let rootView = this._rootView;
|
|
826
|
+
if (Trace.isEnabled()) {
|
|
827
|
+
Trace.write(`Frame.setActivityContent rootView: ${rootView} shouldCreateRootFrame: false fireLaunchEvent: ${fireLaunchEvent}`, Trace.categories.NativeLifecycle);
|
|
828
|
+
}
|
|
829
|
+
const intent = activity.getIntent();
|
|
830
|
+
rootView = Application.createRootView(rootView, fireLaunchEvent, {
|
|
831
|
+
// todo: deprecate in favor of args.intent?
|
|
832
|
+
android: intent,
|
|
833
|
+
intent,
|
|
834
|
+
savedInstanceState,
|
|
835
|
+
});
|
|
836
|
+
if (!rootView) {
|
|
837
|
+
// no root view created
|
|
838
|
+
return;
|
|
839
|
+
}
|
|
840
|
+
activityRootViewsMap.set(rootView._domId, new WeakRef(rootView));
|
|
841
|
+
// setup view as styleScopeHost
|
|
842
|
+
rootView._setupAsRootView(activity);
|
|
843
|
+
if (isEmbedded()) {
|
|
844
|
+
setEmbeddedView(rootView);
|
|
845
|
+
}
|
|
846
|
+
else {
|
|
847
|
+
activity.setContentView(rootView.nativeViewProtected, new org.nativescript.widgets.CommonLayoutParams());
|
|
848
|
+
}
|
|
849
|
+
this._rootView = rootView;
|
|
850
|
+
// sets root classes once rootView is ready...
|
|
851
|
+
Application.initRootView(rootView);
|
|
852
|
+
}
|
|
634
853
|
}
|
|
854
|
+
__decorate([
|
|
855
|
+
profile,
|
|
856
|
+
__metadata("design:type", Function),
|
|
857
|
+
__metadata("design:paramtypes", [androidx.appcompat.app.AppCompatActivity, android.os.Bundle, Object, Function]),
|
|
858
|
+
__metadata("design:returntype", void 0)
|
|
859
|
+
], ActivityCallbacksImplementation.prototype, "onCreate", null);
|
|
860
|
+
__decorate([
|
|
861
|
+
profile,
|
|
862
|
+
__metadata("design:type", Function),
|
|
863
|
+
__metadata("design:paramtypes", [androidx.appcompat.app.AppCompatActivity, android.os.Bundle, Function]),
|
|
864
|
+
__metadata("design:returntype", void 0)
|
|
865
|
+
], ActivityCallbacksImplementation.prototype, "onSaveInstanceState", null);
|
|
866
|
+
__decorate([
|
|
867
|
+
profile,
|
|
868
|
+
__metadata("design:type", Function),
|
|
869
|
+
__metadata("design:paramtypes", [androidx.appcompat.app.AppCompatActivity, android.content.Intent, Function, Function]),
|
|
870
|
+
__metadata("design:returntype", void 0)
|
|
871
|
+
], ActivityCallbacksImplementation.prototype, "onNewIntent", null);
|
|
872
|
+
__decorate([
|
|
873
|
+
profile,
|
|
874
|
+
__metadata("design:type", Function),
|
|
875
|
+
__metadata("design:paramtypes", [Object, Function]),
|
|
876
|
+
__metadata("design:returntype", void 0)
|
|
877
|
+
], ActivityCallbacksImplementation.prototype, "onStart", null);
|
|
878
|
+
__decorate([
|
|
879
|
+
profile,
|
|
880
|
+
__metadata("design:type", Function),
|
|
881
|
+
__metadata("design:paramtypes", [Object, Function]),
|
|
882
|
+
__metadata("design:returntype", void 0)
|
|
883
|
+
], ActivityCallbacksImplementation.prototype, "onStop", null);
|
|
884
|
+
__decorate([
|
|
885
|
+
profile,
|
|
886
|
+
__metadata("design:type", Function),
|
|
887
|
+
__metadata("design:paramtypes", [Object, Function]),
|
|
888
|
+
__metadata("design:returntype", void 0)
|
|
889
|
+
], ActivityCallbacksImplementation.prototype, "onPostResume", null);
|
|
890
|
+
__decorate([
|
|
891
|
+
profile,
|
|
892
|
+
__metadata("design:type", Function),
|
|
893
|
+
__metadata("design:paramtypes", [Object, Function]),
|
|
894
|
+
__metadata("design:returntype", void 0)
|
|
895
|
+
], ActivityCallbacksImplementation.prototype, "onDestroy", null);
|
|
896
|
+
__decorate([
|
|
897
|
+
profile,
|
|
898
|
+
__metadata("design:type", Function),
|
|
899
|
+
__metadata("design:paramtypes", [Object, Function]),
|
|
900
|
+
__metadata("design:returntype", void 0)
|
|
901
|
+
], ActivityCallbacksImplementation.prototype, "onBackPressed", null);
|
|
902
|
+
__decorate([
|
|
903
|
+
profile,
|
|
904
|
+
__metadata("design:type", Function),
|
|
905
|
+
__metadata("design:paramtypes", [Object, Number, Array, Array, Function]),
|
|
906
|
+
__metadata("design:returntype", void 0)
|
|
907
|
+
], ActivityCallbacksImplementation.prototype, "onRequestPermissionsResult", null);
|
|
908
|
+
__decorate([
|
|
909
|
+
profile,
|
|
910
|
+
__metadata("design:type", Function),
|
|
911
|
+
__metadata("design:paramtypes", [Object, Number, Number, android.content.Intent, Function]),
|
|
912
|
+
__metadata("design:returntype", void 0)
|
|
913
|
+
], ActivityCallbacksImplementation.prototype, "onActivityResult", null);
|
|
635
914
|
export function setActivityCallbacks(activity) {
|
|
636
915
|
activity[CALLBACKS] = new ActivityCallbacksImplementation();
|
|
637
916
|
}
|
|
638
|
-
export function setFragmentCallbacks(fragment) {
|
|
639
|
-
fragment[CALLBACKS] = new FragmentCallbacksImplementation();
|
|
640
|
-
}
|
|
641
917
|
//# sourceMappingURL=index.android.js.map
|