@nativescript/core 8.9.0-napi-es5.0 → 8.9.0-napi.1
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/abortcontroller/abortsignal.js +16 -23
- package/abortcontroller/abortsignal.js.map +1 -1
- package/abortcontroller/index.js +14 -20
- package/abortcontroller/index.js.map +1 -1
- package/accessibility/accessibility-common.js +8 -8
- package/accessibility/accessibility-common.js.map +1 -1
- package/accessibility/accessibility-css-helper.js +27 -27
- package/accessibility/accessibility-css-helper.js.map +1 -1
- package/accessibility/accessibility-properties.js +22 -23
- package/accessibility/accessibility-properties.js.map +1 -1
- package/accessibility/accessibility-service-common.js +12 -22
- package/accessibility/accessibility-service-common.js.map +1 -1
- package/accessibility/accessibility-service.android.js +27 -39
- package/accessibility/accessibility-service.android.js.map +1 -1
- package/accessibility/accessibility-service.ios.js +14 -17
- package/accessibility/accessibility-service.ios.js.map +1 -1
- package/accessibility/font-scale-common.js +2 -2
- package/accessibility/font-scale-common.js.map +1 -1
- package/accessibility/font-scale.android.js +7 -8
- package/accessibility/font-scale.android.js.map +1 -1
- package/accessibility/font-scale.ios.js +9 -10
- package/accessibility/font-scale.ios.js.map +1 -1
- package/accessibility/index.android.js +77 -83
- package/accessibility/index.android.js.map +1 -1
- package/accessibility/index.ios.js +34 -36
- package/accessibility/index.ios.js.map +1 -1
- package/animation-frame/animation-native.ios.js +1 -1
- package/animation-frame/animation-native.ios.js.map +1 -1
- package/animation-frame/index.js +16 -16
- package/animation-frame/index.js.map +1 -1
- package/application/application-common.js +196 -214
- package/application/application-common.js.map +1 -1
- package/application/application-shims.js +39 -39
- package/application/application-shims.js.map +1 -1
- package/application/application.android.js +110 -149
- package/application/application.android.js.map +1 -1
- package/application/application.ios.js +162 -197
- package/application/application.ios.js.map +1 -1
- package/application-settings/index.android.js +11 -11
- package/application-settings/index.android.js.map +1 -1
- package/application-settings/index.ios.js +1 -1
- package/application-settings/index.ios.js.map +1 -1
- package/bundle-entry-points.js +1 -1
- package/bundle-entry-points.js.map +1 -1
- package/color/color-common.js +157 -200
- package/color/color-common.js.map +1 -1
- package/color/index.android.js +4 -14
- package/color/index.android.js.map +1 -1
- package/color/index.ios.js +14 -24
- package/color/index.ios.js.map +1 -1
- package/color/known-colors.js +144 -144
- package/color/known-colors.js.map +1 -1
- package/connectivity/index.android.js +23 -23
- package/connectivity/index.android.js.map +1 -1
- package/connectivity/index.ios.js +25 -25
- package/connectivity/index.ios.js.map +1 -1
- package/console/index.js +20 -24
- package/console/index.js.map +1 -1
- package/core-types/index.js +38 -38
- package/core-types/index.js.map +1 -1
- package/css/CSS3Parser.js +104 -106
- package/css/CSS3Parser.js.map +1 -1
- package/css/CSSNativeScript.js +29 -34
- package/css/CSSNativeScript.js.map +1 -1
- package/css/css-tree-parser.js.map +1 -1
- package/css/parser.js +158 -178
- package/css/parser.js.map +1 -1
- package/css/system-classes.js +9 -9
- package/css/system-classes.js.map +1 -1
- package/css-mediaquery/index.js +27 -29
- package/css-mediaquery/index.js.map +1 -1
- package/data/observable/index.js +115 -124
- package/data/observable/index.js.map +1 -1
- package/data/observable-array/index.js +119 -176
- package/data/observable-array/index.js.map +1 -1
- package/data/virtual-array/index.js +61 -74
- package/data/virtual-array/index.js.map +1 -1
- package/debugger/InspectorBackendCommands.js +137 -161
- package/debugger/InspectorBackendCommands.js.map +1 -1
- package/debugger/devtools-elements.common.js +20 -20
- package/debugger/devtools-elements.common.js.map +1 -1
- package/debugger/devtools-elements.js +2 -2
- package/debugger/devtools-elements.js.map +1 -1
- package/debugger/dom-node.js +61 -73
- package/debugger/dom-node.js.map +1 -1
- package/debugger/index.js +19 -19
- package/debugger/index.js.map +1 -1
- package/debugger/webinspector-css.js +25 -30
- package/debugger/webinspector-css.js.map +1 -1
- package/debugger/webinspector-dom.js +38 -43
- package/debugger/webinspector-dom.js.map +1 -1
- package/debugger/webinspector-network.android.js +103 -132
- package/debugger/webinspector-network.android.js.map +1 -1
- package/debugger/webinspector-network.ios.js +100 -128
- package/debugger/webinspector-network.ios.js.map +1 -1
- package/file-system/file-system-access.android.js +414 -421
- package/file-system/file-system-access.android.js.map +1 -1
- package/file-system/file-system-access.ios.js +203 -213
- package/file-system/file-system-access.ios.js.map +1 -1
- package/file-system/index.js +294 -372
- package/file-system/index.js.map +1 -1
- package/fps-meter/fps-native.android.js +15 -18
- package/fps-meter/fps-native.android.js.map +1 -1
- package/fps-meter/fps-native.ios.js +9 -11
- package/fps-meter/fps-native.ios.js.map +1 -1
- package/fps-meter/index.js +11 -11
- package/fps-meter/index.js.map +1 -1
- package/globals/index.js +88 -112
- package/globals/index.js.map +1 -1
- package/http/http-request/http-request-common.js +5 -5
- package/http/http-request/http-request-common.js.map +1 -1
- package/http/http-request/index.android.js +53 -54
- package/http/http-request/index.android.js.map +1 -1
- package/http/http-request/index.ios.js +56 -58
- package/http/http-request/index.ios.js.map +1 -1
- package/http/index.js +19 -19
- package/http/index.js.map +1 -1
- package/image-asset/image-asset-common.js +25 -37
- package/image-asset/image-asset-common.js.map +1 -1
- package/image-asset/index.android.js +17 -25
- package/image-asset/index.android.js.map +1 -1
- package/image-asset/index.ios.js +25 -35
- package/image-asset/index.ios.js.map +1 -1
- package/image-source/image-source-common.js +2 -2
- package/image-source/image-source-common.js.map +1 -1
- package/image-source/index.android.js +152 -178
- package/image-source/index.android.js.map +1 -1
- package/image-source/index.ios.js +177 -203
- package/image-source/index.ios.js.map +1 -1
- package/index.js +4 -8
- package/index.js.map +1 -1
- package/matrix/index.js +17 -27
- package/matrix/index.js.map +1 -1
- package/media-query-list/index.js +61 -87
- package/media-query-list/index.js.map +1 -1
- package/module-name-resolver/index.js +21 -24
- package/module-name-resolver/index.js.map +1 -1
- package/module-name-resolver/non-bundle-workflow-compat.js +24 -24
- package/module-name-resolver/non-bundle-workflow-compat.js.map +1 -1
- package/module-name-resolver/qualifier-matcher/index.js +46 -46
- package/module-name-resolver/qualifier-matcher/index.js.map +1 -1
- package/package.json +1 -1
- package/platform/common.js +5 -5
- package/platform/common.js.map +1 -1
- package/platform/device/index.android.js +68 -107
- package/platform/device/index.android.js.map +1 -1
- package/platform/device/index.ios.js +62 -101
- package/platform/device/index.ios.js.map +1 -1
- package/platform/screen/index.android.js +32 -63
- package/platform/screen/index.android.js.map +1 -1
- package/platform/screen/index.ios.js +29 -60
- package/platform/screen/index.ios.js.map +1 -1
- package/profiling/index.js +40 -47
- package/profiling/index.js.map +1 -1
- package/text/text-common.js +36 -49
- package/text/text-common.js.map +1 -1
- package/timer/index.android.js +20 -30
- package/timer/index.android.js.map +1 -1
- package/timer/index.ios.js +12 -22
- package/timer/index.ios.js.map +1 -1
- package/trace/index.js +26 -36
- package/trace/index.js.map +1 -1
- package/ui/action-bar/action-bar-common.js +193 -252
- package/ui/action-bar/action-bar-common.js.map +1 -1
- package/ui/action-bar/index.android.js +170 -212
- package/ui/action-bar/index.android.js.map +1 -1
- package/ui/action-bar/index.ios.js +208 -251
- package/ui/action-bar/index.ios.js.map +1 -1
- package/ui/activity-indicator/activity-indicator-common.js +6 -11
- package/ui/activity-indicator/activity-indicator-common.js.map +1 -1
- package/ui/activity-indicator/index.android.js +20 -26
- package/ui/activity-indicator/index.android.js.map +1 -1
- package/ui/activity-indicator/index.ios.js +23 -31
- package/ui/activity-indicator/index.ios.js.map +1 -1
- package/ui/animation/animation-common.js +43 -50
- package/ui/animation/animation-common.js.map +1 -1
- package/ui/animation/animation-interfaces.js +3 -5
- package/ui/animation/animation-interfaces.js.map +1 -1
- package/ui/animation/index.android.js +90 -94
- package/ui/animation/index.android.js.map +1 -1
- package/ui/animation/index.ios.js +225 -191
- package/ui/animation/index.ios.js.map +1 -1
- package/ui/animation/keyframe-animation.js +67 -89
- package/ui/animation/keyframe-animation.js.map +1 -1
- package/ui/builder/binding-builder.js +31 -31
- package/ui/builder/binding-builder.js.map +1 -1
- package/ui/builder/component-builder/index.js +37 -37
- package/ui/builder/component-builder/index.js.map +1 -1
- package/ui/builder/index.js +54 -59
- package/ui/builder/index.js.map +1 -1
- package/ui/builder/xml2ui.js +128 -158
- package/ui/builder/xml2ui.js.map +1 -1
- package/ui/button/button-common.js +18 -25
- package/ui/button/button-common.js.map +1 -1
- package/ui/button/index.android.js +69 -80
- package/ui/button/index.android.js.map +1 -1
- package/ui/button/index.ios.js +103 -114
- package/ui/button/index.ios.js.map +1 -1
- package/ui/content-view/index.js +60 -78
- package/ui/content-view/index.js.map +1 -1
- package/ui/core/bindable/bindable-expressions.js +93 -101
- package/ui/core/bindable/bindable-expressions.js.map +1 -1
- package/ui/core/bindable/bindable-resources.js +1 -1
- package/ui/core/bindable/index.js +136 -141
- package/ui/core/bindable/index.js.map +1 -1
- package/ui/core/control-state-change/index.android.js +5 -7
- package/ui/core/control-state-change/index.android.js.map +1 -1
- package/ui/core/control-state-change/index.ios.js +9 -13
- package/ui/core/control-state-change/index.ios.js.map +1 -1
- package/ui/core/properties/index.js +440 -489
- package/ui/core/properties/index.js.map +1 -1
- package/ui/core/view/index.android.js +348 -384
- package/ui/core/view/index.android.js.map +1 -1
- package/ui/core/view/index.ios.js +364 -400
- package/ui/core/view/index.ios.js.map +1 -1
- package/ui/core/view/view-common.js +655 -944
- package/ui/core/view/view-common.js.map +1 -1
- package/ui/core/view/view-helper/index.android.js +15 -19
- package/ui/core/view/view-helper/index.android.js.map +1 -1
- package/ui/core/view/view-helper/index.ios.js +81 -85
- package/ui/core/view/view-helper/index.ios.js.map +1 -1
- package/ui/core/view/view-helper/view-helper-common.js +44 -49
- package/ui/core/view/view-helper/view-helper-common.js.map +1 -1
- package/ui/core/view-base/index.js +371 -426
- package/ui/core/view-base/index.js.map +1 -1
- package/ui/core/weak-event-listener/index.js +25 -26
- package/ui/core/weak-event-listener/index.js.map +1 -1
- package/ui/date-picker/date-picker-common.js +30 -35
- package/ui/date-picker/date-picker-common.js.map +1 -1
- package/ui/date-picker/index.android.js +43 -51
- package/ui/date-picker/index.android.js.map +1 -1
- package/ui/date-picker/index.ios.js +51 -61
- package/ui/date-picker/index.ios.js.map +1 -1
- package/ui/dialogs/dialogs-common.js +18 -18
- package/ui/dialogs/dialogs-common.js.map +1 -1
- package/ui/dialogs/index.android.js +86 -98
- package/ui/dialogs/index.android.js.map +1 -1
- package/ui/dialogs/index.ios.js +67 -80
- package/ui/dialogs/index.ios.js.map +1 -1
- package/ui/editable-text-base/editable-text-base-common.js +29 -35
- package/ui/editable-text-base/editable-text-base-common.js.map +1 -1
- package/ui/editable-text-base/index.android.js +106 -112
- package/ui/editable-text-base/index.android.js.map +1 -1
- package/ui/editable-text-base/index.ios.js +47 -53
- package/ui/editable-text-base/index.ios.js.map +1 -1
- package/ui/embedding/index.android.js +2 -3
- package/ui/embedding/index.android.js.map +1 -1
- package/ui/frame/activity.android.js +44 -44
- package/ui/frame/activity.android.js.map +1 -1
- package/ui/frame/callbacks/activity-callbacks.js +118 -123
- package/ui/frame/callbacks/activity-callbacks.js.map +1 -1
- package/ui/frame/callbacks/fragment-callbacks.js +139 -141
- package/ui/frame/callbacks/fragment-callbacks.js.map +1 -1
- package/ui/frame/fragment.android.js +21 -21
- package/ui/frame/fragment.android.js.map +1 -1
- package/ui/frame/fragment.ios.js +1 -1
- package/ui/frame/fragment.transitions.android.js +105 -114
- package/ui/frame/fragment.transitions.android.js.map +1 -1
- package/ui/frame/frame-common.d.ts +1 -1
- package/ui/frame/frame-common.js +249 -285
- package/ui/frame/frame-common.js.map +1 -1
- package/ui/frame/frame-helpers.js +1 -1
- package/ui/frame/frame-helpers.js.map +1 -1
- package/ui/frame/frame-stack.js +4 -4
- package/ui/frame/frame-stack.js.map +1 -1
- package/ui/frame/index.android.js +239 -291
- package/ui/frame/index.android.js.map +1 -1
- package/ui/frame/index.ios.js +133 -167
- package/ui/frame/index.ios.js.map +1 -1
- package/ui/gestures/gestures-common.js +15 -29
- package/ui/gestures/gestures-common.js.map +1 -1
- package/ui/gestures/index.android.js +108 -124
- package/ui/gestures/index.android.js.map +1 -1
- package/ui/gestures/index.ios.js +108 -121
- package/ui/gestures/index.ios.js.map +1 -1
- package/ui/gestures/touch-manager.js +42 -48
- package/ui/gestures/touch-manager.js.map +1 -1
- package/ui/html-view/html-view-common.js +9 -14
- package/ui/html-view/html-view-common.js.map +1 -1
- package/ui/html-view/index.android.js +37 -43
- package/ui/html-view/index.android.js.map +1 -1
- package/ui/html-view/index.ios.js +62 -73
- package/ui/html-view/index.ios.js.map +1 -1
- package/ui/image/image-common.js +47 -57
- package/ui/image/image-common.js.map +1 -1
- package/ui/image/index.android.js +54 -59
- package/ui/image/index.android.js.map +1 -1
- package/ui/image/index.ios.js +65 -72
- package/ui/image/index.ios.js.map +1 -1
- package/ui/image/symbol-effects-common.js +2 -6
- package/ui/image/symbol-effects-common.js.map +1 -1
- package/ui/image/symbol-effects.android.js +4 -10
- package/ui/image/symbol-effects.android.js.map +1 -1
- package/ui/image/symbol-effects.ios.js +7 -11
- package/ui/image/symbol-effects.ios.js.map +1 -1
- package/ui/image-cache/image-cache-common.js +57 -61
- package/ui/image-cache/image-cache-common.js.map +1 -1
- package/ui/image-cache/index.android.js +23 -27
- package/ui/image-cache/index.android.js.map +1 -1
- package/ui/image-cache/index.ios.js +24 -29
- package/ui/image-cache/index.ios.js.map +1 -1
- package/ui/label/index.android.js +29 -38
- package/ui/label/index.android.js.map +1 -1
- package/ui/label/index.ios.js +89 -102
- package/ui/label/index.ios.js.map +1 -1
- package/ui/layouts/absolute-layout/absolute-layout-common.js +25 -30
- package/ui/layouts/absolute-layout/absolute-layout-common.js.map +1 -1
- package/ui/layouts/absolute-layout/index.android.js +6 -12
- package/ui/layouts/absolute-layout/index.android.js.map +1 -1
- package/ui/layouts/absolute-layout/index.ios.js +32 -40
- package/ui/layouts/absolute-layout/index.ios.js.map +1 -1
- package/ui/layouts/dock-layout/dock-layout-common.js +16 -21
- package/ui/layouts/dock-layout/dock-layout-common.js.map +1 -1
- package/ui/layouts/dock-layout/index.android.js +11 -17
- package/ui/layouts/dock-layout/index.android.js.map +1 -1
- package/ui/layouts/dock-layout/index.ios.js +45 -53
- package/ui/layouts/dock-layout/index.ios.js.map +1 -1
- package/ui/layouts/flexbox-layout/flexbox-layout-common.js +90 -115
- package/ui/layouts/flexbox-layout/flexbox-layout-common.js.map +1 -1
- package/ui/layouts/flexbox-layout/index.android.js +92 -97
- package/ui/layouts/flexbox-layout/index.android.js.map +1 -1
- package/ui/layouts/flexbox-layout/index.ios.js +366 -427
- package/ui/layouts/flexbox-layout/index.ios.js.map +1 -1
- package/ui/layouts/grid-layout/grid-layout-common.js +159 -211
- package/ui/layouts/grid-layout/grid-layout-common.js.map +1 -1
- package/ui/layouts/grid-layout/index.android.js +49 -55
- package/ui/layouts/grid-layout/index.android.js.map +1 -1
- package/ui/layouts/grid-layout/index.ios.js +340 -348
- package/ui/layouts/grid-layout/index.ios.js.map +1 -1
- package/ui/layouts/layout-base-common.js +78 -106
- package/ui/layouts/layout-base-common.js.map +1 -1
- package/ui/layouts/layout-base.android.js +25 -31
- package/ui/layouts/layout-base.android.js.map +1 -1
- package/ui/layouts/layout-base.ios.js +21 -27
- package/ui/layouts/layout-base.ios.js.map +1 -1
- package/ui/layouts/root-layout/index.android.js +47 -46
- package/ui/layouts/root-layout/index.android.js.map +1 -1
- package/ui/layouts/root-layout/index.ios.js +54 -53
- package/ui/layouts/root-layout/index.ios.js.map +1 -1
- package/ui/layouts/root-layout/root-layout-common.js +186 -190
- package/ui/layouts/root-layout/root-layout-common.js.map +1 -1
- package/ui/layouts/stack-layout/index.android.js +6 -12
- package/ui/layouts/stack-layout/index.android.js.map +1 -1
- package/ui/layouts/stack-layout/index.ios.js +62 -69
- package/ui/layouts/stack-layout/index.ios.js.map +1 -1
- package/ui/layouts/stack-layout/stack-layout-common.js +7 -12
- package/ui/layouts/stack-layout/stack-layout-common.js.map +1 -1
- package/ui/layouts/wrap-layout/index.android.js +10 -16
- package/ui/layouts/wrap-layout/index.android.js.map +1 -1
- package/ui/layouts/wrap-layout/index.ios.js +70 -76
- package/ui/layouts/wrap-layout/index.ios.js.map +1 -1
- package/ui/layouts/wrap-layout/wrap-layout-common.js +13 -18
- package/ui/layouts/wrap-layout/wrap-layout-common.js.map +1 -1
- package/ui/list-picker/index.android.js +42 -48
- package/ui/list-picker/index.android.js.map +1 -1
- package/ui/list-picker/index.ios.js +26 -36
- package/ui/list-picker/index.ios.js.map +1 -1
- package/ui/list-picker/list-picker-common.js +27 -32
- package/ui/list-picker/list-picker-common.js.map +1 -1
- package/ui/list-view/index.android.js +98 -110
- package/ui/list-view/index.android.js.map +1 -1
- package/ui/list-view/index.ios.js +121 -137
- package/ui/list-view/index.ios.js.map +1 -1
- package/ui/list-view/list-view-common.js +100 -116
- package/ui/list-view/list-view-common.js.map +1 -1
- package/ui/page/index.android.js +57 -65
- package/ui/page/index.android.js.map +1 -1
- package/ui/page/index.ios.js +98 -107
- package/ui/page/index.ios.js.map +1 -1
- package/ui/page/page-common.js +113 -145
- package/ui/page/page-common.js.map +1 -1
- package/ui/placeholder/index.android.js +10 -16
- package/ui/placeholder/index.android.js.map +1 -1
- package/ui/placeholder/index.js +6 -12
- package/ui/placeholder/index.js.map +1 -1
- package/ui/progress/index.android.js +28 -34
- package/ui/progress/index.android.js.map +1 -1
- package/ui/progress/index.ios.js +29 -39
- package/ui/progress/index.ios.js.map +1 -1
- package/ui/progress/progress-common.js +11 -16
- package/ui/progress/progress-common.js.map +1 -1
- package/ui/proxy-view-container/index.js +90 -111
- package/ui/proxy-view-container/index.js.map +1 -1
- package/ui/repeater/index.js +100 -112
- package/ui/repeater/index.js.map +1 -1
- package/ui/scroll-view/index.android.d.ts +1 -1
- package/ui/scroll-view/index.android.js +75 -95
- package/ui/scroll-view/index.android.js.map +1 -1
- package/ui/scroll-view/index.ios.js +72 -92
- package/ui/scroll-view/index.ios.js.map +1 -1
- package/ui/scroll-view/scroll-view-common.js +45 -65
- package/ui/scroll-view/scroll-view-common.js.map +1 -1
- package/ui/search-bar/index.android.js +88 -94
- package/ui/search-bar/index.android.js.map +1 -1
- package/ui/search-bar/index.ios.js +74 -88
- package/ui/search-bar/index.ios.js.map +1 -1
- package/ui/search-bar/search-bar-common.js +13 -18
- package/ui/search-bar/search-bar-common.js.map +1 -1
- package/ui/segmented-bar/index.android.js +98 -112
- package/ui/segmented-bar/index.android.js.map +1 -1
- package/ui/segmented-bar/index.ios.js +63 -80
- package/ui/segmented-bar/index.ios.js.map +1 -1
- package/ui/segmented-bar/segmented-bar-common.js +61 -81
- package/ui/segmented-bar/segmented-bar-common.js.map +1 -1
- package/ui/slider/index.android.js +43 -49
- package/ui/slider/index.android.js.map +1 -1
- package/ui/slider/index.ios.js +49 -59
- package/ui/slider/index.ios.js.map +1 -1
- package/ui/slider/slider-common.js +28 -35
- package/ui/slider/slider-common.js.map +1 -1
- package/ui/styling/background-common.js +98 -100
- package/ui/styling/background-common.js.map +1 -1
- package/ui/styling/background.android.js +35 -38
- package/ui/styling/background.android.js.map +1 -1
- package/ui/styling/background.ios.js +252 -258
- package/ui/styling/background.ios.js.map +1 -1
- package/ui/styling/box-shadow.js +2 -6
- package/ui/styling/box-shadow.js.map +1 -1
- package/ui/styling/converters.js +7 -7
- package/ui/styling/converters.js.map +1 -1
- package/ui/styling/css-animation-parser.js +56 -69
- package/ui/styling/css-animation-parser.js.map +1 -1
- package/ui/styling/css-selector.js +425 -522
- package/ui/styling/css-selector.js.map +1 -1
- package/ui/styling/css-shadow.js +2 -2
- package/ui/styling/css-shadow.js.map +1 -1
- package/ui/styling/css-stroke.js +3 -3
- package/ui/styling/css-stroke.js.map +1 -1
- package/ui/styling/css-utils.js +22 -22
- package/ui/styling/css-utils.js.map +1 -1
- package/ui/styling/font-common.js +44 -59
- package/ui/styling/font-common.js.map +1 -1
- package/ui/styling/font.android.js +34 -42
- package/ui/styling/font.android.js.map +1 -1
- package/ui/styling/font.ios.js +49 -54
- package/ui/styling/font.ios.js.map +1 -1
- package/ui/styling/linear-gradient.js +13 -17
- package/ui/styling/linear-gradient.js.map +1 -1
- package/ui/styling/style/index.js +36 -47
- package/ui/styling/style/index.js.map +1 -1
- package/ui/styling/style-properties.js +291 -306
- package/ui/styling/style-properties.js.map +1 -1
- package/ui/styling/style-scope.js +377 -416
- package/ui/styling/style-scope.js.map +1 -1
- package/ui/switch/index.android.js +41 -47
- package/ui/switch/index.android.js.map +1 -1
- package/ui/switch/index.ios.js +57 -66
- package/ui/switch/index.ios.js.map +1 -1
- package/ui/switch/switch-common.js +11 -16
- package/ui/switch/switch-common.js.map +1 -1
- package/ui/tab-view/index.android.js +187 -206
- package/ui/tab-view/index.android.js.map +1 -1
- package/ui/tab-view/index.ios.js +161 -177
- package/ui/tab-view/index.ios.js.map +1 -1
- package/ui/tab-view/tab-view-common.js +143 -197
- package/ui/tab-view/tab-view-common.js.map +1 -1
- package/ui/text-base/formatted-string.js +105 -158
- package/ui/text-base/formatted-string.js.map +1 -1
- package/ui/text-base/index.android.js +130 -136
- package/ui/text-base/index.android.js.map +1 -1
- package/ui/text-base/index.ios.js +112 -120
- package/ui/text-base/index.ios.js.map +1 -1
- package/ui/text-base/span.js +102 -158
- package/ui/text-base/span.js.map +1 -1
- package/ui/text-base/text-base-common.js +181 -268
- package/ui/text-base/text-base-common.js.map +1 -1
- package/ui/text-field/index.android.js +18 -24
- package/ui/text-field/index.android.js.map +1 -1
- package/ui/text-field/index.ios.js +70 -80
- package/ui/text-field/index.ios.js.map +1 -1
- package/ui/text-field/text-field-common.js +8 -13
- package/ui/text-field/text-field-common.js.map +1 -1
- package/ui/text-view/index.android.js +13 -19
- package/ui/text-view/index.android.js.map +1 -1
- package/ui/text-view/index.ios.js +116 -124
- package/ui/text-view/index.ios.js.map +1 -1
- package/ui/text-view/text-view-common.js +3 -9
- package/ui/text-view/text-view-common.js.map +1 -1
- package/ui/time-picker/index.android.js +18 -24
- package/ui/time-picker/index.android.js.map +1 -1
- package/ui/time-picker/index.ios.js +61 -69
- package/ui/time-picker/index.ios.js.map +1 -1
- package/ui/time-picker/time-picker-common.js +37 -42
- package/ui/time-picker/time-picker-common.js.map +1 -1
- package/ui/transition/fade-transition.android.js +8 -14
- package/ui/transition/fade-transition.android.js.map +1 -1
- package/ui/transition/fade-transition.ios.js +4 -10
- package/ui/transition/fade-transition.ios.js.map +1 -1
- package/ui/transition/flip-transition.android.js +14 -18
- package/ui/transition/flip-transition.android.js.map +1 -1
- package/ui/transition/index.android.js +24 -27
- package/ui/transition/index.android.js.map +1 -1
- package/ui/transition/index.ios.js +18 -22
- package/ui/transition/index.ios.js.map +1 -1
- package/ui/transition/modal-transition.android.js +4 -10
- package/ui/transition/modal-transition.android.js.map +1 -1
- package/ui/transition/modal-transition.ios.js +18 -25
- package/ui/transition/modal-transition.ios.js.map +1 -1
- package/ui/transition/page-transition.android.js +57 -71
- package/ui/transition/page-transition.android.js.map +1 -1
- package/ui/transition/page-transition.ios.js +19 -27
- package/ui/transition/page-transition.ios.js.map +1 -1
- package/ui/transition/shared-transition-helper.android.js +8 -12
- package/ui/transition/shared-transition-helper.android.js.map +1 -1
- package/ui/transition/shared-transition-helper.ios.js +442 -539
- package/ui/transition/shared-transition-helper.ios.js.map +1 -1
- package/ui/transition/shared-transition.js +77 -76
- package/ui/transition/shared-transition.js.map +1 -1
- package/ui/transition/slide-transition.android.js +17 -22
- package/ui/transition/slide-transition.android.js.map +1 -1
- package/ui/transition/slide-transition.ios.js +7 -11
- package/ui/transition/slide-transition.ios.js.map +1 -1
- package/ui/utils.ios.js +13 -13
- package/ui/utils.ios.js.map +1 -1
- package/ui/web-view/index.android.js +50 -64
- package/ui/web-view/index.android.js.map +1 -1
- package/ui/web-view/index.ios.js +50 -73
- package/ui/web-view/index.ios.js.map +1 -1
- package/ui/web-view/web-view-common.js +29 -43
- package/ui/web-view/web-view-common.js.map +1 -1
- package/utils/android/index.js +26 -27
- package/utils/android/index.js.map +1 -1
- package/utils/common.js +49 -65
- package/utils/common.js.map +1 -1
- package/utils/constants.android.js +1 -1
- package/utils/constants.android.js.map +1 -1
- package/utils/constants.ios.js +1 -1
- package/utils/constants.ios.js.map +1 -1
- package/utils/debug.js +32 -54
- package/utils/debug.js.map +1 -1
- package/utils/index.android.js +40 -36
- package/utils/index.android.js.map +1 -1
- package/utils/index.ios.js +9 -9
- package/utils/index.ios.js.map +1 -1
- package/utils/ios/index.js +45 -42
- package/utils/ios/index.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.ios.js +2 -2
- package/utils/layout-helper/index.ios.js.map +1 -1
- package/utils/layout-helper/layout-helper-common.js +13 -13
- package/utils/layout-helper/layout-helper-common.js.map +1 -1
- package/utils/lazy.js +2 -2
- package/utils/lazy.js.map +1 -1
- package/utils/macrotask-scheduler.js +6 -6
- package/utils/macrotask-scheduler.js.map +1 -1
- package/utils/mainthread-helper.android.js +4 -4
- package/utils/mainthread-helper.android.js.map +1 -1
- package/utils/mainthread-helper.ios.js +1 -1
- package/utils/mainthread-helper.ios.js.map +1 -1
- package/utils/module-merge.js +1 -1
- package/utils/module-merge.js.map +1 -1
- package/utils/native-helper.android.js +19 -19
- package/utils/native-helper.android.js.map +1 -1
- package/utils/native-helper.ios.js +16 -23
- package/utils/native-helper.ios.js.map +1 -1
- package/utils/number-utils.js +3 -3
- package/utils/number-utils.js.map +1 -1
- package/utils/platform-check.js +6 -6
- package/utils/platform-check.js.map +1 -1
- package/utils/types.js +33 -43
- package/utils/types.js.map +1 -1
- package/wgc/crypto/SubtleCrypto.js +132 -167
- package/wgc/crypto/SubtleCrypto.js.map +1 -1
- package/wgc/crypto/index.d.ts +1 -1
- package/wgc/crypto/index.js +10 -18
- package/wgc/crypto/index.js.map +1 -1
- package/xhr/index.js +226 -308
- package/xhr/index.js.map +1 -1
- package/xml/index.js +78 -118
- package/xml/index.js.map +1 -1
|
@@ -19,25 +19,25 @@ export * from './view-common';
|
|
|
19
19
|
export * from './view-helper';
|
|
20
20
|
// This one can eventually be cleaned up but causes issues with a lot of ui-suite plugins in particular if not exported here
|
|
21
21
|
export * from '../properties';
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
22
|
+
const DOMID = '_domId';
|
|
23
|
+
const androidBackPressedEvent = 'androidBackPressed';
|
|
24
|
+
const shortAnimTime = 17694720; // android.R.integer.config_shortAnimTime
|
|
25
|
+
const statePressed = 16842919; // android.R.attr.state_pressed
|
|
26
|
+
const stateEnabled = 16842910; // android.R.attr.state_enabled
|
|
27
|
+
const styleAnimationDialog = 16973826; // android.R.style.Animation_Dialog
|
|
28
|
+
const VERTICAL_GRAVITY_MASK = 112; // android.view.Gravity.VERTICAL_GRAVITY_MASK
|
|
29
|
+
const HORIZONTAL_GRAVITY_MASK = 7; // android.view.Gravity.HORIZONTAL_GRAVITY_MASK
|
|
30
|
+
const GRAVITY_LEFT = 3; // android.view.Gravity.LEFT
|
|
31
|
+
const GRAVITY_RIGHT = 5; // android.view.Gravity.RIGHT
|
|
32
|
+
const GRAVITY_TOP = 48; // android.view.Gravity.TOP
|
|
33
|
+
const GRAVITY_BOTTOM = 80; // android.view.Gravity.BOTTOM
|
|
34
|
+
const GRAVITY_CENTER_HORIZONTAL = 1; // android.view.Gravity.CENTER_HORIZONTAL
|
|
35
|
+
const GRAVITY_FILL_HORIZONTAL = 7; // android.view.Gravity.FILL_HORIZONTAL
|
|
36
|
+
const GRAVITY_CENTER_VERTICAL = 16; // android.view.Gravity.CENTER_VERTICAL
|
|
37
|
+
const GRAVITY_FILL_VERTICAL = 112; // android.view.Gravity.FILL_VERTICAL
|
|
38
|
+
const modalMap = new Map();
|
|
39
|
+
let TouchListener;
|
|
40
|
+
let DialogFragment;
|
|
41
41
|
function initializeTouchListener() {
|
|
42
42
|
if (TouchListener) {
|
|
43
43
|
return;
|
|
@@ -239,55 +239,51 @@ function removeModal(domId) {
|
|
|
239
239
|
function getModalOptions(domId) {
|
|
240
240
|
return modalMap.get(domId);
|
|
241
241
|
}
|
|
242
|
-
|
|
243
|
-
__extends(View, _super);
|
|
244
|
-
function View() {
|
|
245
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
246
|
-
}
|
|
242
|
+
export class View extends ViewCommon {
|
|
247
243
|
// TODO: Implement unobserve that detach the touchListener.
|
|
248
|
-
|
|
249
|
-
|
|
244
|
+
_observe(type, callback, thisArg) {
|
|
245
|
+
super._observe(type, callback, thisArg);
|
|
250
246
|
if (this.isLoaded && !this.touchListenerIsSet) {
|
|
251
247
|
this.setOnTouchListener();
|
|
252
248
|
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
249
|
+
}
|
|
250
|
+
addEventListener(eventNames, callback, thisArg) {
|
|
251
|
+
super.addEventListener(eventNames, callback, thisArg);
|
|
252
|
+
const isLayoutEvent = typeof eventNames === 'string' ? eventNames.indexOf(ViewCommon.layoutChangedEvent) !== -1 : false;
|
|
257
253
|
if (this.isLoaded && !this.layoutChangeListenerIsSet && isLayoutEvent) {
|
|
258
254
|
this.setOnLayoutChangeListener();
|
|
259
255
|
}
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
256
|
+
}
|
|
257
|
+
removeEventListener(eventNames, callback, thisArg) {
|
|
258
|
+
super.removeEventListener(eventNames, callback, thisArg);
|
|
259
|
+
const isLayoutEvent = typeof eventNames === 'string' ? eventNames.indexOf(ViewCommon.layoutChangedEvent) !== -1 : false;
|
|
264
260
|
// Remove native listener only if there are no more user listeners for LayoutChanged event
|
|
265
261
|
if (this.isLoaded && this.layoutChangeListenerIsSet && isLayoutEvent && !this.needsOnLayoutChangeListener()) {
|
|
266
262
|
this.nativeViewProtected.removeOnLayoutChangeListener(this.layoutChangeListener);
|
|
267
263
|
this.layoutChangeListenerIsSet = false;
|
|
268
264
|
}
|
|
269
|
-
}
|
|
270
|
-
|
|
265
|
+
}
|
|
266
|
+
_getChildFragmentManager() {
|
|
271
267
|
return null;
|
|
272
|
-
}
|
|
273
|
-
|
|
268
|
+
}
|
|
269
|
+
_getRootFragmentManager() {
|
|
274
270
|
if (!this._rootManager && this._context) {
|
|
275
271
|
this._rootManager = this._context.getSupportFragmentManager();
|
|
276
272
|
}
|
|
277
273
|
return this._rootManager;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
|
|
274
|
+
}
|
|
275
|
+
_getFragmentManager() {
|
|
276
|
+
let manager = this._manager;
|
|
281
277
|
if (!manager) {
|
|
282
|
-
|
|
283
|
-
|
|
278
|
+
let view = this;
|
|
279
|
+
let frameOrTabViewItemFound = false;
|
|
284
280
|
while (view) {
|
|
285
281
|
// when interacting with nested fragments instead of using getSupportFragmentManager
|
|
286
282
|
// we must always use getChildFragmentManager instead;
|
|
287
283
|
// we have three sources of fragments -- Frame fragments, TabViewItem fragments, and
|
|
288
284
|
// modal dialog fragments
|
|
289
285
|
// modal -> frame / tabview (frame / tabview use modal CHILD fm)
|
|
290
|
-
|
|
286
|
+
const dialogFragment = view._dialogFragment;
|
|
291
287
|
if (dialogFragment) {
|
|
292
288
|
manager = dialogFragment.getChildFragmentManager();
|
|
293
289
|
break;
|
|
@@ -313,51 +309,51 @@ var View = /** @class */ (function (_super) {
|
|
|
313
309
|
this._manager = manager;
|
|
314
310
|
}
|
|
315
311
|
return manager;
|
|
316
|
-
}
|
|
317
|
-
|
|
312
|
+
}
|
|
313
|
+
onLoaded() {
|
|
318
314
|
this._manager = null;
|
|
319
315
|
this._rootManager = null;
|
|
320
|
-
|
|
316
|
+
super.onLoaded();
|
|
321
317
|
this.setOnTouchListener();
|
|
322
|
-
}
|
|
323
|
-
|
|
318
|
+
}
|
|
319
|
+
onUnloaded() {
|
|
324
320
|
this._manager = null;
|
|
325
321
|
this._rootManager = null;
|
|
326
|
-
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
|
|
322
|
+
super.onUnloaded();
|
|
323
|
+
}
|
|
324
|
+
onBackPressed() {
|
|
325
|
+
const topmostFrame = topmost();
|
|
330
326
|
// Delegate back navigation handling to the topmost Frame
|
|
331
327
|
// when it's a child of the current View.
|
|
332
328
|
if (topmostFrame && topmostFrame._hasAncestorView(this)) {
|
|
333
329
|
return topmostFrame.onBackPressed();
|
|
334
330
|
}
|
|
335
331
|
return false;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
for (
|
|
339
|
-
|
|
340
|
-
list.forEach(
|
|
332
|
+
}
|
|
333
|
+
handleGestureTouch(event) {
|
|
334
|
+
for (const type in this._gestureObservers) {
|
|
335
|
+
const list = this._gestureObservers[type];
|
|
336
|
+
list.forEach((element) => {
|
|
341
337
|
element.androidOnTouchEvent(event);
|
|
342
338
|
});
|
|
343
339
|
}
|
|
344
340
|
if (this.parent instanceof View) {
|
|
345
341
|
this.parent.handleGestureTouch(event);
|
|
346
342
|
}
|
|
347
|
-
}
|
|
348
|
-
|
|
343
|
+
}
|
|
344
|
+
hasGestureObservers() {
|
|
349
345
|
return this._gestureObservers && Object.keys(this._gestureObservers).length > 0;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
|
|
346
|
+
}
|
|
347
|
+
initNativeView() {
|
|
348
|
+
super.initNativeView();
|
|
353
349
|
if (this.needsOnLayoutChangeListener()) {
|
|
354
350
|
this.setOnLayoutChangeListener();
|
|
355
351
|
}
|
|
356
|
-
}
|
|
357
|
-
|
|
352
|
+
}
|
|
353
|
+
needsOnLayoutChangeListener() {
|
|
358
354
|
return this.hasListeners(ViewCommon.layoutChangedEvent);
|
|
359
|
-
}
|
|
360
|
-
|
|
355
|
+
}
|
|
356
|
+
disposeNativeView() {
|
|
361
357
|
if (this.touchListenerIsSet) {
|
|
362
358
|
this.touchListenerIsSet = false;
|
|
363
359
|
if (this.nativeViewProtected) {
|
|
@@ -371,9 +367,9 @@ var View = /** @class */ (function (_super) {
|
|
|
371
367
|
this.layoutChangeListener = null;
|
|
372
368
|
}
|
|
373
369
|
}
|
|
374
|
-
|
|
375
|
-
}
|
|
376
|
-
|
|
370
|
+
super.disposeNativeView();
|
|
371
|
+
}
|
|
372
|
+
setOnTouchListener() {
|
|
377
373
|
if (this.touchListenerIsSet || !this.nativeViewProtected || !this.hasGestureObservers()) {
|
|
378
374
|
return;
|
|
379
375
|
}
|
|
@@ -386,80 +382,68 @@ var View = /** @class */ (function (_super) {
|
|
|
386
382
|
if (this.nativeViewProtected.setClickable) {
|
|
387
383
|
this.nativeViewProtected.setClickable(this.isUserInteractionEnabled);
|
|
388
384
|
}
|
|
389
|
-
}
|
|
390
|
-
|
|
385
|
+
}
|
|
386
|
+
setOnLayoutChangeListener() {
|
|
391
387
|
if (this.nativeViewProtected) {
|
|
392
|
-
|
|
388
|
+
const owner = this;
|
|
393
389
|
this.layoutChangeListenerIsSet = true;
|
|
394
390
|
this.layoutChangeListener =
|
|
395
391
|
this.layoutChangeListener ||
|
|
396
392
|
new android.view.View.OnLayoutChangeListener({
|
|
397
|
-
onLayoutChange
|
|
393
|
+
onLayoutChange(v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) {
|
|
398
394
|
if (left !== oldLeft || top !== oldTop || right !== oldRight || bottom !== oldBottom) {
|
|
399
|
-
|
|
395
|
+
owner._raiseLayoutChangedEvent();
|
|
400
396
|
}
|
|
401
397
|
},
|
|
402
398
|
});
|
|
403
399
|
this.nativeViewProtected.addOnLayoutChangeListener(this.layoutChangeListener);
|
|
404
400
|
}
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
},
|
|
420
|
-
enumerable: false,
|
|
421
|
-
configurable: true
|
|
422
|
-
});
|
|
423
|
-
Object.defineProperty(View.prototype, "_hasFragments", {
|
|
424
|
-
get: function () {
|
|
425
|
-
return false;
|
|
426
|
-
},
|
|
427
|
-
enumerable: false,
|
|
428
|
-
configurable: true
|
|
429
|
-
});
|
|
430
|
-
View.prototype.layoutNativeView = function (left, top, right, bottom) {
|
|
401
|
+
}
|
|
402
|
+
get isLayoutRequired() {
|
|
403
|
+
return !this.isLayoutValid;
|
|
404
|
+
}
|
|
405
|
+
get isLayoutValid() {
|
|
406
|
+
if (this.nativeViewProtected) {
|
|
407
|
+
return !this.nativeViewProtected.isLayoutRequested();
|
|
408
|
+
}
|
|
409
|
+
return false;
|
|
410
|
+
}
|
|
411
|
+
get _hasFragments() {
|
|
412
|
+
return false;
|
|
413
|
+
}
|
|
414
|
+
layoutNativeView(left, top, right, bottom) {
|
|
431
415
|
if (this.nativeViewProtected) {
|
|
432
416
|
this.nativeViewProtected.layout(left, top, right, bottom);
|
|
433
417
|
}
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
|
|
418
|
+
}
|
|
419
|
+
requestLayout() {
|
|
420
|
+
super.requestLayout();
|
|
437
421
|
if (this.nativeViewProtected) {
|
|
438
422
|
this.nativeViewProtected.requestLayout();
|
|
439
423
|
}
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
|
|
424
|
+
}
|
|
425
|
+
measure(widthMeasureSpec, heightMeasureSpec) {
|
|
426
|
+
super.measure(widthMeasureSpec, heightMeasureSpec);
|
|
443
427
|
this.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
|
|
428
|
+
}
|
|
429
|
+
layout(left, top, right, bottom) {
|
|
430
|
+
super.layout(left, top, right, bottom);
|
|
447
431
|
this.onLayout(left, top, right, bottom);
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
|
|
432
|
+
}
|
|
433
|
+
onMeasure(widthMeasureSpec, heightMeasureSpec) {
|
|
434
|
+
const view = this.nativeViewProtected;
|
|
451
435
|
if (view) {
|
|
452
436
|
view.measure(widthMeasureSpec, heightMeasureSpec);
|
|
453
437
|
this.setMeasuredDimension(view.getMeasuredWidth(), view.getMeasuredHeight());
|
|
454
438
|
}
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
|
|
439
|
+
}
|
|
440
|
+
onLayout(left, top, right, bottom) {
|
|
441
|
+
const view = this.nativeViewProtected;
|
|
458
442
|
if (view) {
|
|
459
443
|
this.layoutNativeView(left, top, right, bottom);
|
|
460
444
|
}
|
|
461
|
-
}
|
|
462
|
-
|
|
445
|
+
}
|
|
446
|
+
_getCurrentLayoutBounds() {
|
|
463
447
|
if (this.nativeViewProtected && !this.isCollapsed) {
|
|
464
448
|
return {
|
|
465
449
|
left: this.nativeViewProtected.getLeft(),
|
|
@@ -471,62 +455,62 @@ var View = /** @class */ (function (_super) {
|
|
|
471
455
|
else {
|
|
472
456
|
return { left: 0, top: 0, right: 0, bottom: 0 };
|
|
473
457
|
}
|
|
474
|
-
}
|
|
475
|
-
|
|
458
|
+
}
|
|
459
|
+
getMeasuredWidth() {
|
|
476
460
|
if (this.nativeViewProtected) {
|
|
477
461
|
return this.nativeViewProtected.getMeasuredWidth();
|
|
478
462
|
}
|
|
479
|
-
return
|
|
480
|
-
}
|
|
481
|
-
|
|
463
|
+
return super.getMeasuredWidth();
|
|
464
|
+
}
|
|
465
|
+
getMeasuredHeight() {
|
|
482
466
|
if (this.nativeViewProtected) {
|
|
483
467
|
return this.nativeViewProtected.getMeasuredHeight();
|
|
484
468
|
}
|
|
485
|
-
return
|
|
486
|
-
}
|
|
487
|
-
|
|
469
|
+
return super.getMeasuredHeight();
|
|
470
|
+
}
|
|
471
|
+
focus() {
|
|
488
472
|
if (this.nativeViewProtected) {
|
|
489
473
|
return this.nativeViewProtected.requestFocus();
|
|
490
474
|
}
|
|
491
475
|
return false;
|
|
492
|
-
}
|
|
493
|
-
|
|
476
|
+
}
|
|
477
|
+
getLocationInWindow() {
|
|
494
478
|
if (!this.nativeViewProtected || !this.nativeViewProtected.getWindowToken()) {
|
|
495
479
|
return undefined;
|
|
496
480
|
}
|
|
497
|
-
|
|
481
|
+
const nativeArray = Array.create('int', 2);
|
|
498
482
|
this.nativeViewProtected.getLocationInWindow(nativeArray);
|
|
499
483
|
return {
|
|
500
484
|
x: layout.toDeviceIndependentPixels(nativeArray[0]),
|
|
501
485
|
y: layout.toDeviceIndependentPixels(nativeArray[1]),
|
|
502
486
|
};
|
|
503
|
-
}
|
|
504
|
-
|
|
487
|
+
}
|
|
488
|
+
getLocationOnScreen() {
|
|
505
489
|
if (!this.nativeViewProtected || !this.nativeViewProtected.getWindowToken()) {
|
|
506
490
|
return undefined;
|
|
507
491
|
}
|
|
508
|
-
|
|
492
|
+
const nativeArray = Array.create('int', 2);
|
|
509
493
|
this.nativeViewProtected.getLocationOnScreen(nativeArray);
|
|
510
494
|
return {
|
|
511
495
|
x: layout.toDeviceIndependentPixels(nativeArray[0]),
|
|
512
496
|
y: layout.toDeviceIndependentPixels(nativeArray[1]),
|
|
513
497
|
};
|
|
514
|
-
}
|
|
515
|
-
|
|
498
|
+
}
|
|
499
|
+
getLocationRelativeTo(otherView) {
|
|
516
500
|
if (!this.nativeViewProtected || !this.nativeViewProtected.getWindowToken() || !otherView || !otherView.nativeViewProtected || !otherView.nativeViewProtected.getWindowToken() || this.nativeViewProtected.getWindowToken() !== otherView.nativeViewProtected.getWindowToken()) {
|
|
517
501
|
return undefined;
|
|
518
502
|
}
|
|
519
|
-
|
|
503
|
+
const myArray = Array.create('int', 2);
|
|
520
504
|
this.nativeViewProtected.getLocationOnScreen(myArray);
|
|
521
|
-
|
|
505
|
+
const otherArray = Array.create('int', 2);
|
|
522
506
|
otherView.nativeViewProtected.getLocationOnScreen(otherArray);
|
|
523
507
|
return {
|
|
524
508
|
x: layout.toDeviceIndependentPixels(myArray[0] - otherArray[0]),
|
|
525
509
|
y: layout.toDeviceIndependentPixels(myArray[1] - otherArray[1]),
|
|
526
510
|
};
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
|
|
511
|
+
}
|
|
512
|
+
static resolveSizeAndState(size, specSize, specMode, childMeasuredState) {
|
|
513
|
+
let result = size;
|
|
530
514
|
switch (specMode) {
|
|
531
515
|
case layout.UNSPECIFIED:
|
|
532
516
|
result = size;
|
|
@@ -541,28 +525,27 @@ var View = /** @class */ (function (_super) {
|
|
|
541
525
|
break;
|
|
542
526
|
}
|
|
543
527
|
return result | (childMeasuredState & layout.MEASURED_STATE_MASK);
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
var _this = this;
|
|
528
|
+
}
|
|
529
|
+
_showNativeModalView(parent, options) {
|
|
547
530
|
// if the app is in background while triggering _showNativeModalView
|
|
548
531
|
// then DialogFragment.show will trigger IllegalStateException: Can not perform this action after onSaveInstanceState
|
|
549
532
|
// so if in background we create an event to call _showNativeModalView when loaded (going back in foreground)
|
|
550
533
|
if (Application.inBackground && !parent.isLoaded) {
|
|
551
|
-
|
|
552
|
-
parent.off('loaded',
|
|
553
|
-
|
|
534
|
+
const onLoaded = () => {
|
|
535
|
+
parent.off('loaded', onLoaded);
|
|
536
|
+
this._showNativeModalView(parent, options);
|
|
554
537
|
};
|
|
555
|
-
parent.on('loaded',
|
|
538
|
+
parent.on('loaded', onLoaded);
|
|
556
539
|
return;
|
|
557
540
|
}
|
|
558
|
-
|
|
541
|
+
super._showNativeModalView(parent, options);
|
|
559
542
|
initializeDialogFragment();
|
|
560
|
-
|
|
561
|
-
|
|
543
|
+
const df = new DialogFragment();
|
|
544
|
+
const args = new android.os.Bundle();
|
|
562
545
|
args.putInt(DOMID, this._domId);
|
|
563
546
|
df.setArguments(args);
|
|
564
|
-
|
|
565
|
-
|
|
547
|
+
let cancelable = true;
|
|
548
|
+
let windowSoftInputMode;
|
|
566
549
|
if (options.android) {
|
|
567
550
|
if (options.android.cancelable !== undefined) {
|
|
568
551
|
cancelable = !!options.android.cancelable;
|
|
@@ -571,58 +554,58 @@ var View = /** @class */ (function (_super) {
|
|
|
571
554
|
windowSoftInputMode = options.android.windowSoftInputMode;
|
|
572
555
|
}
|
|
573
556
|
cancelable = options.cancelable !== undefined ? !!options.cancelable : cancelable;
|
|
574
|
-
|
|
557
|
+
const dialogOptions = {
|
|
575
558
|
owner: this,
|
|
576
559
|
fullscreen: !!options.fullscreen,
|
|
577
560
|
animated: !!options.animated,
|
|
578
561
|
stretched: !!options.stretched,
|
|
579
562
|
cancelable: cancelable,
|
|
580
563
|
windowSoftInputMode: windowSoftInputMode,
|
|
581
|
-
shownCallback:
|
|
582
|
-
dismissCallback:
|
|
564
|
+
shownCallback: () => this._raiseShownModallyEvent(),
|
|
565
|
+
dismissCallback: () => this.closeModal(),
|
|
583
566
|
};
|
|
584
567
|
saveModal(dialogOptions);
|
|
585
568
|
this._dialogFragment = df;
|
|
586
569
|
this._raiseShowingModallyEvent();
|
|
587
570
|
this._dialogFragment.show(parent._getRootFragmentManager(), this._domId.toString());
|
|
588
|
-
}
|
|
589
|
-
|
|
571
|
+
}
|
|
572
|
+
_hideNativeModalView(parent, whenClosedCallback) {
|
|
590
573
|
if (this._dialogFragment) {
|
|
591
|
-
|
|
574
|
+
const manager = this._dialogFragment.getFragmentManager();
|
|
592
575
|
if (manager) {
|
|
593
576
|
this._dialogFragment.dismissAllowingStateLoss();
|
|
594
577
|
}
|
|
595
578
|
}
|
|
596
579
|
this._dialogFragment = null;
|
|
597
580
|
whenClosedCallback();
|
|
598
|
-
}
|
|
599
|
-
|
|
581
|
+
}
|
|
582
|
+
[isEnabledProperty.setNative](value) {
|
|
600
583
|
this.nativeViewProtected.setEnabled(value);
|
|
601
|
-
}
|
|
602
|
-
|
|
584
|
+
}
|
|
585
|
+
[originXProperty.getDefault]() {
|
|
603
586
|
return this.nativeViewProtected.getPivotX();
|
|
604
|
-
}
|
|
605
|
-
|
|
587
|
+
}
|
|
588
|
+
[originXProperty.setNative](value) {
|
|
606
589
|
org.nativescript.widgets.OriginPoint.setX(this.nativeViewProtected, value);
|
|
607
|
-
}
|
|
608
|
-
|
|
590
|
+
}
|
|
591
|
+
[originYProperty.getDefault]() {
|
|
609
592
|
return this.nativeViewProtected.getPivotY();
|
|
610
|
-
}
|
|
611
|
-
|
|
593
|
+
}
|
|
594
|
+
[originYProperty.setNative](value) {
|
|
612
595
|
org.nativescript.widgets.OriginPoint.setY(this.nativeViewProtected, value);
|
|
613
|
-
}
|
|
614
|
-
|
|
596
|
+
}
|
|
597
|
+
[isUserInteractionEnabledProperty.setNative](value) {
|
|
615
598
|
this.nativeViewProtected.setClickable(value);
|
|
616
599
|
this.nativeViewProtected.setFocusable(value);
|
|
617
|
-
}
|
|
618
|
-
|
|
600
|
+
}
|
|
601
|
+
[hiddenProperty.getDefault]() {
|
|
619
602
|
return this.nativeViewProtected.getVisibility() === android.view.View.GONE;
|
|
620
|
-
}
|
|
621
|
-
|
|
603
|
+
}
|
|
604
|
+
[hiddenProperty.setNative](value) {
|
|
622
605
|
this.nativeViewProtected.setVisibility(value ? android.view.View.GONE : android.view.View.VISIBLE);
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
|
|
606
|
+
}
|
|
607
|
+
[visibilityProperty.getDefault]() {
|
|
608
|
+
const nativeVisibility = this.nativeViewProtected.getVisibility();
|
|
626
609
|
switch (nativeVisibility) {
|
|
627
610
|
case android.view.View.VISIBLE:
|
|
628
611
|
return 'visible';
|
|
@@ -631,10 +614,10 @@ var View = /** @class */ (function (_super) {
|
|
|
631
614
|
case android.view.View.GONE:
|
|
632
615
|
return 'collapse';
|
|
633
616
|
default:
|
|
634
|
-
throw new Error(
|
|
617
|
+
throw new Error(`Unsupported android.view.View visibility: ${nativeVisibility}. Currently supported values are android.view.View.VISIBLE, android.view.View.INVISIBLE, android.view.View.GONE.`);
|
|
635
618
|
}
|
|
636
|
-
}
|
|
637
|
-
|
|
619
|
+
}
|
|
620
|
+
[visibilityProperty.setNative](value) {
|
|
638
621
|
switch (value) {
|
|
639
622
|
case 'visible':
|
|
640
623
|
this.nativeViewProtected.setVisibility(android.view.View.VISIBLE);
|
|
@@ -646,20 +629,20 @@ var View = /** @class */ (function (_super) {
|
|
|
646
629
|
this.nativeViewProtected.setVisibility(android.view.View.GONE);
|
|
647
630
|
break;
|
|
648
631
|
default:
|
|
649
|
-
throw new Error(
|
|
632
|
+
throw new Error(`Invalid visibility value: ${value}. Valid values are: visible, hidden, collapse.`);
|
|
650
633
|
}
|
|
651
|
-
}
|
|
652
|
-
|
|
634
|
+
}
|
|
635
|
+
[opacityProperty.getDefault]() {
|
|
653
636
|
return this.nativeViewProtected.getAlpha();
|
|
654
|
-
}
|
|
655
|
-
|
|
637
|
+
}
|
|
638
|
+
[opacityProperty.setNative](value) {
|
|
656
639
|
this.nativeViewProtected.setAlpha(float(value));
|
|
657
|
-
}
|
|
658
|
-
|
|
640
|
+
}
|
|
641
|
+
[testIDProperty.setNative](value) {
|
|
659
642
|
this.setAccessibilityIdentifier(this.nativeViewProtected, value);
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
|
|
643
|
+
}
|
|
644
|
+
setAccessibilityIdentifier(view, value) {
|
|
645
|
+
const id = Utils.android.resources.getId(':id/nativescript_accessibility_id');
|
|
663
646
|
if (id) {
|
|
664
647
|
view.setTag(id, value);
|
|
665
648
|
view.setTag(value);
|
|
@@ -668,43 +651,42 @@ var View = /** @class */ (function (_super) {
|
|
|
668
651
|
this.testID = value;
|
|
669
652
|
if (this.accessibilityIdentifier !== value)
|
|
670
653
|
this.accessibilityIdentifier = value;
|
|
671
|
-
}
|
|
672
|
-
|
|
654
|
+
}
|
|
655
|
+
[accessibilityEnabledProperty.setNative](value) {
|
|
673
656
|
this.nativeViewProtected.setFocusable(!!value);
|
|
674
657
|
updateAccessibilityProperties(this);
|
|
675
|
-
}
|
|
676
|
-
|
|
658
|
+
}
|
|
659
|
+
[accessibilityIdentifierProperty.setNative](value) {
|
|
677
660
|
this.setAccessibilityIdentifier(this.nativeViewProtected, value);
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
var _a;
|
|
661
|
+
}
|
|
662
|
+
[accessibilityRoleProperty.setNative](value) {
|
|
681
663
|
this.accessibilityRole = value;
|
|
682
664
|
updateAccessibilityProperties(this);
|
|
683
665
|
if (SDK_VERSION >= 28) {
|
|
684
|
-
|
|
666
|
+
this.nativeViewProtected?.setAccessibilityHeading(value === AccessibilityRole.Header);
|
|
685
667
|
}
|
|
686
|
-
}
|
|
687
|
-
|
|
668
|
+
}
|
|
669
|
+
[accessibilityValueProperty.setNative]() {
|
|
688
670
|
this._androidContentDescriptionUpdated = true;
|
|
689
671
|
updateContentDescription(this);
|
|
690
|
-
}
|
|
691
|
-
|
|
672
|
+
}
|
|
673
|
+
[accessibilityLabelProperty.setNative]() {
|
|
692
674
|
this._androidContentDescriptionUpdated = true;
|
|
693
675
|
updateContentDescription(this);
|
|
694
|
-
}
|
|
695
|
-
|
|
676
|
+
}
|
|
677
|
+
[accessibilityHintProperty.setNative]() {
|
|
696
678
|
this._androidContentDescriptionUpdated = true;
|
|
697
679
|
updateContentDescription(this);
|
|
698
|
-
}
|
|
699
|
-
|
|
680
|
+
}
|
|
681
|
+
[accessibilityHiddenProperty.setNative](value) {
|
|
700
682
|
if (value) {
|
|
701
683
|
this.nativeViewProtected.setImportantForAccessibility(android.view.View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS);
|
|
702
684
|
}
|
|
703
685
|
else {
|
|
704
686
|
this.nativeViewProtected.setImportantForAccessibility(android.view.View.IMPORTANT_FOR_ACCESSIBILITY_YES);
|
|
705
687
|
}
|
|
706
|
-
}
|
|
707
|
-
|
|
688
|
+
}
|
|
689
|
+
[accessibilityLiveRegionProperty.setNative](value) {
|
|
708
690
|
switch (value) {
|
|
709
691
|
case AccessibilityLiveRegion.Assertive: {
|
|
710
692
|
this.nativeViewProtected.setAccessibilityLiveRegion(android.view.View.ACCESSIBILITY_LIVE_REGION_ASSERTIVE);
|
|
@@ -719,84 +701,84 @@ var View = /** @class */ (function (_super) {
|
|
|
719
701
|
break;
|
|
720
702
|
}
|
|
721
703
|
}
|
|
722
|
-
}
|
|
723
|
-
|
|
704
|
+
}
|
|
705
|
+
[accessibilityStateProperty.setNative](value) {
|
|
724
706
|
this.accessibilityState = value;
|
|
725
707
|
updateAccessibilityProperties(this);
|
|
726
|
-
}
|
|
727
|
-
|
|
708
|
+
}
|
|
709
|
+
[accessibilityMediaSessionProperty.setNative]() {
|
|
728
710
|
updateAccessibilityProperties(this);
|
|
729
|
-
}
|
|
730
|
-
|
|
711
|
+
}
|
|
712
|
+
[androidElevationProperty.getDefault]() {
|
|
731
713
|
return this.getDefaultElevation();
|
|
732
|
-
}
|
|
733
|
-
|
|
714
|
+
}
|
|
715
|
+
[androidElevationProperty.setNative](value) {
|
|
734
716
|
if (SDK_VERSION < 21) {
|
|
735
717
|
return;
|
|
736
718
|
}
|
|
737
719
|
this.refreshStateListAnimator();
|
|
738
|
-
}
|
|
739
|
-
|
|
720
|
+
}
|
|
721
|
+
[androidDynamicElevationOffsetProperty.getDefault]() {
|
|
740
722
|
return this.getDefaultDynamicElevationOffset();
|
|
741
|
-
}
|
|
742
|
-
|
|
723
|
+
}
|
|
724
|
+
[androidDynamicElevationOffsetProperty.setNative](value) {
|
|
743
725
|
if (SDK_VERSION < 21) {
|
|
744
726
|
return;
|
|
745
727
|
}
|
|
746
728
|
this.refreshStateListAnimator();
|
|
747
|
-
}
|
|
748
|
-
|
|
729
|
+
}
|
|
730
|
+
getDefaultElevation() {
|
|
749
731
|
if (SDK_VERSION < 21) {
|
|
750
732
|
return 0;
|
|
751
733
|
}
|
|
752
734
|
// NOTE: overriden in Button implementation as for widgets with StateListAnimator (Button)
|
|
753
735
|
// nativeView.getElevation() returns 0 at the time of the getDefault() query
|
|
754
736
|
return layout.toDeviceIndependentPixels(this.nativeViewProtected.getElevation());
|
|
755
|
-
}
|
|
756
|
-
|
|
737
|
+
}
|
|
738
|
+
getDefaultDynamicElevationOffset() {
|
|
757
739
|
// NOTE: overriden in Button implementation
|
|
758
740
|
return 0;
|
|
759
|
-
}
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
741
|
+
}
|
|
742
|
+
refreshStateListAnimator() {
|
|
743
|
+
const nativeView = this.nativeViewProtected;
|
|
744
|
+
const ObjectAnimator = android.animation.ObjectAnimator;
|
|
745
|
+
const AnimatorSet = android.animation.AnimatorSet;
|
|
746
|
+
const duration = nativeView.getContext().getResources().getInteger(shortAnimTime) / 2;
|
|
747
|
+
let elevation = this.androidElevation;
|
|
766
748
|
if (typeof elevation === 'undefined' || elevation === null) {
|
|
767
749
|
elevation = this.getDefaultElevation();
|
|
768
750
|
}
|
|
769
751
|
elevation = layout.toDevicePixels(elevation);
|
|
770
|
-
|
|
771
|
-
|
|
752
|
+
const z = layout.toDevicePixels(0);
|
|
753
|
+
let pressedZ = this.androidDynamicElevationOffset;
|
|
772
754
|
if (typeof pressedZ === 'undefined' || pressedZ === null) {
|
|
773
755
|
pressedZ = this.getDefaultDynamicElevationOffset();
|
|
774
756
|
}
|
|
775
757
|
pressedZ = layout.toDevicePixels(pressedZ);
|
|
776
|
-
|
|
758
|
+
const pressedSet = new AnimatorSet();
|
|
777
759
|
pressedSet.playTogether(java.util.Arrays.asList([ObjectAnimator.ofFloat(nativeView, 'translationZ', [pressedZ]).setDuration(duration), ObjectAnimator.ofFloat(nativeView, 'elevation', [elevation]).setDuration(0)]));
|
|
778
|
-
|
|
760
|
+
const notPressedSet = new AnimatorSet();
|
|
779
761
|
notPressedSet.playTogether(java.util.Arrays.asList([ObjectAnimator.ofFloat(nativeView, 'translationZ', [z]).setDuration(duration), ObjectAnimator.ofFloat(nativeView, 'elevation', [elevation]).setDuration(0)]));
|
|
780
|
-
|
|
762
|
+
const defaultSet = new AnimatorSet();
|
|
781
763
|
defaultSet.playTogether(java.util.Arrays.asList([ObjectAnimator.ofFloat(nativeView, 'translationZ', [0]).setDuration(0), ObjectAnimator.ofFloat(nativeView, 'elevation', [0]).setDuration(0)]));
|
|
782
|
-
|
|
764
|
+
const stateListAnimator = new android.animation.StateListAnimator();
|
|
783
765
|
stateListAnimator.addState([statePressed, stateEnabled], pressedSet);
|
|
784
766
|
stateListAnimator.addState([stateEnabled], notPressedSet);
|
|
785
767
|
stateListAnimator.addState([], defaultSet);
|
|
786
|
-
|
|
768
|
+
const currentAnimator = nativeView.getStateListAnimator();
|
|
787
769
|
if (currentAnimator) {
|
|
788
770
|
currentAnimator.jumpToCurrentState();
|
|
789
771
|
}
|
|
790
772
|
nativeView.setStateListAnimator(stateListAnimator);
|
|
791
|
-
}
|
|
792
|
-
|
|
773
|
+
}
|
|
774
|
+
[horizontalAlignmentProperty.getDefault]() {
|
|
793
775
|
return org.nativescript.widgets.ViewHelper.getHorizontalAlignment(this.nativeViewProtected);
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
776
|
+
}
|
|
777
|
+
[horizontalAlignmentProperty.setNative](value) {
|
|
778
|
+
const nativeView = this.nativeViewProtected;
|
|
779
|
+
const lp = nativeView.getLayoutParams() || new org.nativescript.widgets.CommonLayoutParams();
|
|
780
|
+
const gravity = lp.gravity;
|
|
781
|
+
const weight = lp.weight;
|
|
800
782
|
// Set only if params gravity exists.
|
|
801
783
|
if (gravity !== undefined) {
|
|
802
784
|
switch (value) {
|
|
@@ -827,15 +809,15 @@ var View = /** @class */ (function (_super) {
|
|
|
827
809
|
}
|
|
828
810
|
nativeView.setLayoutParams(lp);
|
|
829
811
|
}
|
|
830
|
-
}
|
|
831
|
-
|
|
812
|
+
}
|
|
813
|
+
[verticalAlignmentProperty.getDefault]() {
|
|
832
814
|
return org.nativescript.widgets.ViewHelper.getVerticalAlignment(this.nativeViewProtected);
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
815
|
+
}
|
|
816
|
+
[verticalAlignmentProperty.setNative](value) {
|
|
817
|
+
const nativeView = this.nativeViewProtected;
|
|
818
|
+
const lp = nativeView.getLayoutParams() || new org.nativescript.widgets.CommonLayoutParams();
|
|
819
|
+
const gravity = lp.gravity;
|
|
820
|
+
const height = lp.height;
|
|
839
821
|
// Set only if params gravity exists.
|
|
840
822
|
if (gravity !== undefined) {
|
|
841
823
|
switch (value) {
|
|
@@ -866,65 +848,64 @@ var View = /** @class */ (function (_super) {
|
|
|
866
848
|
}
|
|
867
849
|
nativeView.setLayoutParams(lp);
|
|
868
850
|
}
|
|
869
|
-
}
|
|
870
|
-
|
|
851
|
+
}
|
|
852
|
+
[rotateProperty.setNative](value) {
|
|
871
853
|
org.nativescript.widgets.ViewHelper.setRotate(this.nativeViewProtected, float(value));
|
|
872
|
-
}
|
|
873
|
-
|
|
854
|
+
}
|
|
855
|
+
[rotateXProperty.setNative](value) {
|
|
874
856
|
org.nativescript.widgets.ViewHelper.setRotateX(this.nativeViewProtected, float(value));
|
|
875
|
-
}
|
|
876
|
-
|
|
857
|
+
}
|
|
858
|
+
[rotateYProperty.setNative](value) {
|
|
877
859
|
org.nativescript.widgets.ViewHelper.setRotateY(this.nativeViewProtected, float(value));
|
|
878
|
-
}
|
|
879
|
-
|
|
860
|
+
}
|
|
861
|
+
[perspectiveProperty.setNative](value) {
|
|
880
862
|
org.nativescript.widgets.ViewHelper.setPerspective(this.nativeViewProtected, float(value * Screen.mainScreen.scale));
|
|
881
|
-
}
|
|
882
|
-
|
|
863
|
+
}
|
|
864
|
+
[scaleXProperty.setNative](value) {
|
|
883
865
|
org.nativescript.widgets.ViewHelper.setScaleX(this.nativeViewProtected, float(value));
|
|
884
|
-
}
|
|
885
|
-
|
|
866
|
+
}
|
|
867
|
+
[scaleYProperty.setNative](value) {
|
|
886
868
|
org.nativescript.widgets.ViewHelper.setScaleY(this.nativeViewProtected, float(value));
|
|
887
|
-
}
|
|
888
|
-
|
|
869
|
+
}
|
|
870
|
+
[translateXProperty.setNative](value) {
|
|
889
871
|
org.nativescript.widgets.ViewHelper.setTranslateX(this.nativeViewProtected, layout.toDevicePixels(value));
|
|
890
|
-
}
|
|
891
|
-
|
|
872
|
+
}
|
|
873
|
+
[translateYProperty.setNative](value) {
|
|
892
874
|
org.nativescript.widgets.ViewHelper.setTranslateY(this.nativeViewProtected, layout.toDevicePixels(value));
|
|
893
|
-
}
|
|
894
|
-
|
|
875
|
+
}
|
|
876
|
+
[zIndexProperty.getDefault]() {
|
|
895
877
|
return 0;
|
|
896
|
-
}
|
|
897
|
-
|
|
878
|
+
}
|
|
879
|
+
[zIndexProperty.setNative](value) {
|
|
898
880
|
org.nativescript.widgets.ViewHelper.setZIndex(this.nativeViewProtected, value);
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
|
|
881
|
+
}
|
|
882
|
+
[backgroundInternalProperty.getDefault]() {
|
|
883
|
+
const nativeView = this.nativeViewProtected;
|
|
902
884
|
return AndroidHelper.getCopyOrDrawable(nativeView.getBackground(), nativeView.getResources());
|
|
903
|
-
}
|
|
904
|
-
|
|
885
|
+
}
|
|
886
|
+
[backgroundInternalProperty.setNative](value) {
|
|
905
887
|
this._redrawNativeBackground(value);
|
|
906
|
-
}
|
|
907
|
-
|
|
888
|
+
}
|
|
889
|
+
[minWidthProperty.setNative](value) {
|
|
908
890
|
if (this.parent instanceof CustomLayoutView && this.parent.nativeViewProtected) {
|
|
909
891
|
this.parent._setChildMinWidthNative(this, value);
|
|
910
892
|
}
|
|
911
893
|
else {
|
|
912
894
|
this._setMinWidthNative(value);
|
|
913
895
|
}
|
|
914
|
-
}
|
|
915
|
-
|
|
896
|
+
}
|
|
897
|
+
[minHeightProperty.setNative](value) {
|
|
916
898
|
if (this.parent instanceof CustomLayoutView && this.parent.nativeViewProtected) {
|
|
917
899
|
this.parent._setChildMinHeightNative(this, value);
|
|
918
900
|
}
|
|
919
901
|
else {
|
|
920
902
|
this._setMinHeightNative(value);
|
|
921
903
|
}
|
|
922
|
-
}
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
var nativeView = this.nativeViewProtected;
|
|
904
|
+
}
|
|
905
|
+
_applyBackground(background, isBorderDrawable, onlyColor, backgroundDrawable) {
|
|
906
|
+
const nativeView = this.nativeViewProtected;
|
|
926
907
|
if (onlyColor) {
|
|
927
|
-
|
|
908
|
+
const backgroundColor = background.color.android;
|
|
928
909
|
if (isBorderDrawable) {
|
|
929
910
|
// We need to duplicate the drawable or we lose the "default" cached drawable
|
|
930
911
|
backgroundDrawable = nativeView._cachedDrawable != null ? AndroidHelper.getCopyOrDrawable(nativeView._cachedDrawable, nativeView.getResources()) : null;
|
|
@@ -953,7 +934,7 @@ var View = /** @class */ (function (_super) {
|
|
|
953
934
|
}
|
|
954
935
|
if (background.isEmpty()) {
|
|
955
936
|
// Reset background to default if not already set
|
|
956
|
-
|
|
937
|
+
const defaultDrawable = nativeView._cachedDrawable ?? null;
|
|
957
938
|
if (backgroundDrawable !== defaultDrawable) {
|
|
958
939
|
nativeView.setBackground(defaultDrawable);
|
|
959
940
|
}
|
|
@@ -964,16 +945,16 @@ var View = /** @class */ (function (_super) {
|
|
|
964
945
|
refreshBorderDrawable(this, backgroundDrawable);
|
|
965
946
|
}
|
|
966
947
|
else {
|
|
967
|
-
|
|
948
|
+
const borderDrawable = new org.nativescript.widgets.BorderDrawable(layout.getDisplayDensity(), this.toString());
|
|
968
949
|
refreshBorderDrawable(this, borderDrawable);
|
|
969
950
|
nativeView.setBackground(borderDrawable);
|
|
970
951
|
}
|
|
971
952
|
}
|
|
972
953
|
}
|
|
973
|
-
}
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
954
|
+
}
|
|
955
|
+
_drawBoxShadow(boxShadow) {
|
|
956
|
+
const nativeView = this.nativeViewProtected;
|
|
957
|
+
const config = {
|
|
977
958
|
shadowColor: boxShadow.color.android,
|
|
978
959
|
cornerRadius: Length.toDevicePixels(this.borderRadius, 0.0),
|
|
979
960
|
spreadRadius: boxShadow.spreadRadius,
|
|
@@ -982,19 +963,19 @@ var View = /** @class */ (function (_super) {
|
|
|
982
963
|
offsetY: boxShadow.offsetY,
|
|
983
964
|
};
|
|
984
965
|
org.nativescript.widgets.Utils.drawBoxShadow(nativeView, JSON.stringify(config));
|
|
985
|
-
}
|
|
986
|
-
|
|
966
|
+
}
|
|
967
|
+
_redrawNativeBackground(value) {
|
|
987
968
|
if (value instanceof Background) {
|
|
988
969
|
this.onBackgroundOrBorderPropertyChanged();
|
|
989
970
|
}
|
|
990
971
|
else {
|
|
991
|
-
|
|
972
|
+
const nativeView = this.nativeViewProtected;
|
|
992
973
|
nativeView.setBackground(value);
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
974
|
+
const style = this.style;
|
|
975
|
+
const paddingTop = paddingTopProperty.isSet(style) ? this.effectivePaddingTop : this._defaultPaddingTop;
|
|
976
|
+
const paddingRight = paddingRightProperty.isSet(style) ? this.effectivePaddingRight : this._defaultPaddingRight;
|
|
977
|
+
const paddingBottom = paddingBottomProperty.isSet(style) ? this.effectivePaddingBottom : this._defaultPaddingBottom;
|
|
978
|
+
const paddingLeft = paddingLeftProperty.isSet(style) ? this.effectivePaddingLeft : this._defaultPaddingLeft;
|
|
998
979
|
if (this._isPaddingRelative) {
|
|
999
980
|
nativeView.setPaddingRelative(paddingLeft, paddingTop, paddingRight, paddingBottom);
|
|
1000
981
|
}
|
|
@@ -1002,16 +983,15 @@ var View = /** @class */ (function (_super) {
|
|
|
1002
983
|
nativeView.setPadding(paddingLeft, paddingTop, paddingRight, paddingBottom);
|
|
1003
984
|
}
|
|
1004
985
|
}
|
|
1005
|
-
}
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
var nativeView = this.nativeViewProtected;
|
|
986
|
+
}
|
|
987
|
+
onBackgroundOrBorderPropertyChanged() {
|
|
988
|
+
const nativeView = this.nativeViewProtected;
|
|
1009
989
|
if (!nativeView) {
|
|
1010
990
|
return;
|
|
1011
991
|
}
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
992
|
+
const background = this.style.backgroundInternal;
|
|
993
|
+
const drawable = nativeView.getBackground();
|
|
994
|
+
const isBorderDrawable = drawable instanceof org.nativescript.widgets.BorderDrawable;
|
|
1015
995
|
// Use undefined as not set. getBackground will never return undefined only Drawable or null;
|
|
1016
996
|
if (nativeView._cachedDrawable === undefined) {
|
|
1017
997
|
nativeView._cachedDrawable = drawable;
|
|
@@ -1019,11 +999,11 @@ var View = /** @class */ (function (_super) {
|
|
|
1019
999
|
if (background.clearFlags & 2 /* BackgroundClearFlags.CLEAR_BOX_SHADOW */) {
|
|
1020
1000
|
// Clear background if we're clearing the box shadow
|
|
1021
1001
|
if (drawable instanceof org.nativescript.widgets.BoxShadowDrawable) {
|
|
1022
|
-
nativeView.setBackground(
|
|
1002
|
+
nativeView.setBackground(nativeView._cachedDrawable ?? null);
|
|
1023
1003
|
}
|
|
1024
1004
|
}
|
|
1025
1005
|
// prettier-ignore
|
|
1026
|
-
|
|
1006
|
+
const onlyColor = !background.hasBorderWidth()
|
|
1027
1007
|
&& !background.hasBorderRadius()
|
|
1028
1008
|
&& !background.hasBoxShadow()
|
|
1029
1009
|
&& !background.clipPath
|
|
@@ -1035,10 +1015,10 @@ var View = /** @class */ (function (_super) {
|
|
|
1035
1015
|
}
|
|
1036
1016
|
// TODO: Can we move BorderWidths as separate native setter?
|
|
1037
1017
|
// This way we could skip setPadding if borderWidth is not changed.
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1018
|
+
const leftPadding = Math.ceil(this.effectiveBorderLeftWidth + this.effectivePaddingLeft);
|
|
1019
|
+
const topPadding = Math.ceil(this.effectiveBorderTopWidth + this.effectivePaddingTop);
|
|
1020
|
+
const rightPadding = Math.ceil(this.effectiveBorderRightWidth + this.effectivePaddingRight);
|
|
1021
|
+
const bottomPadding = Math.ceil(this.effectiveBorderBottomWidth + this.effectivePaddingBottom);
|
|
1042
1022
|
if (this._isPaddingRelative) {
|
|
1043
1023
|
nativeView.setPaddingRelative(leftPadding, topPadding, rightPadding, bottomPadding);
|
|
1044
1024
|
}
|
|
@@ -1047,63 +1027,49 @@ var View = /** @class */ (function (_super) {
|
|
|
1047
1027
|
}
|
|
1048
1028
|
// reset clear flags
|
|
1049
1029
|
background.clearFlags = 0 /* BackgroundClearFlags.NONE */;
|
|
1050
|
-
}
|
|
1051
|
-
|
|
1052
|
-
if (message === void 0) { message = this.accessibilityLabel; }
|
|
1030
|
+
}
|
|
1031
|
+
accessibilityAnnouncement(message = this.accessibilityLabel) {
|
|
1053
1032
|
this.sendAccessibilityEvent({
|
|
1054
1033
|
androidAccessibilityEvent: AndroidAccessibilityEvent.ANNOUNCEMENT,
|
|
1055
|
-
message
|
|
1034
|
+
message,
|
|
1056
1035
|
});
|
|
1057
|
-
}
|
|
1058
|
-
|
|
1036
|
+
}
|
|
1037
|
+
accessibilityScreenChanged() {
|
|
1059
1038
|
this.sendAccessibilityEvent({
|
|
1060
1039
|
androidAccessibilityEvent: AndroidAccessibilityEvent.WINDOW_STATE_CHANGED,
|
|
1061
1040
|
});
|
|
1062
|
-
}
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
function ContainerView() {
|
|
1088
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1089
|
-
}
|
|
1090
|
-
return ContainerView;
|
|
1091
|
-
}(View));
|
|
1092
|
-
export { ContainerView };
|
|
1093
|
-
var CustomLayoutView = /** @class */ (function (_super) {
|
|
1094
|
-
__extends(CustomLayoutView, _super);
|
|
1095
|
-
function CustomLayoutView() {
|
|
1096
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1097
|
-
}
|
|
1098
|
-
CustomLayoutView.prototype.createNativeView = function () {
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
View.androidBackPressedEvent = androidBackPressedEvent;
|
|
1044
|
+
__decorate([
|
|
1045
|
+
profile,
|
|
1046
|
+
__metadata("design:type", Function),
|
|
1047
|
+
__metadata("design:paramtypes", []),
|
|
1048
|
+
__metadata("design:returntype", void 0)
|
|
1049
|
+
], View.prototype, "onLoaded", null);
|
|
1050
|
+
__decorate([
|
|
1051
|
+
profile,
|
|
1052
|
+
__metadata("design:type", Function),
|
|
1053
|
+
__metadata("design:paramtypes", []),
|
|
1054
|
+
__metadata("design:returntype", void 0)
|
|
1055
|
+
], View.prototype, "onUnloaded", null);
|
|
1056
|
+
__decorate([
|
|
1057
|
+
profile,
|
|
1058
|
+
__metadata("design:type", Function),
|
|
1059
|
+
__metadata("design:paramtypes", []),
|
|
1060
|
+
__metadata("design:returntype", void 0)
|
|
1061
|
+
], View.prototype, "requestLayout", null);
|
|
1062
|
+
export class ContainerView extends View {
|
|
1063
|
+
}
|
|
1064
|
+
export class CustomLayoutView extends ContainerView {
|
|
1065
|
+
createNativeView() {
|
|
1099
1066
|
return new org.nativescript.widgets.ContentLayout(this._context);
|
|
1100
|
-
}
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
_super.prototype._addViewToNativeVisualTree.call(this, child);
|
|
1067
|
+
}
|
|
1068
|
+
_addViewToNativeVisualTree(child, atIndex = Number.MAX_SAFE_INTEGER) {
|
|
1069
|
+
super._addViewToNativeVisualTree(child);
|
|
1104
1070
|
if (this.nativeViewProtected && child.nativeViewProtected) {
|
|
1105
1071
|
if (Trace.isEnabled()) {
|
|
1106
|
-
Trace.write(
|
|
1072
|
+
Trace.write(`${this}.nativeView.addView(${child}.nativeView, ${atIndex})`, Trace.categories.VisualTreeEvents);
|
|
1107
1073
|
}
|
|
1108
1074
|
this.nativeViewProtected.addView(child.nativeViewProtected, atIndex);
|
|
1109
1075
|
if (child instanceof View) {
|
|
@@ -1112,37 +1078,35 @@ var CustomLayoutView = /** @class */ (function (_super) {
|
|
|
1112
1078
|
return true;
|
|
1113
1079
|
}
|
|
1114
1080
|
return false;
|
|
1115
|
-
}
|
|
1116
|
-
|
|
1081
|
+
}
|
|
1082
|
+
_updateNativeLayoutParams(child) {
|
|
1117
1083
|
// noop
|
|
1118
|
-
}
|
|
1119
|
-
|
|
1084
|
+
}
|
|
1085
|
+
_setChildMinWidthNative(child, value) {
|
|
1120
1086
|
child._setMinWidthNative(value);
|
|
1121
|
-
}
|
|
1122
|
-
|
|
1087
|
+
}
|
|
1088
|
+
_setChildMinHeightNative(child, value) {
|
|
1123
1089
|
child._setMinHeightNative(value);
|
|
1124
|
-
}
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1090
|
+
}
|
|
1091
|
+
_removeViewFromNativeVisualTree(child) {
|
|
1092
|
+
super._removeViewFromNativeVisualTree(child);
|
|
1093
|
+
const nativeView = this.nativeViewProtected;
|
|
1094
|
+
const childView = child.nativeViewProtected;
|
|
1129
1095
|
if (nativeView && childView) {
|
|
1130
1096
|
nativeView.removeView(childView);
|
|
1131
1097
|
if (Trace.isEnabled()) {
|
|
1132
|
-
Trace.write(
|
|
1098
|
+
Trace.write(`${nativeView}.removeView(${childView})`, Trace.categories.VisualTreeEvents);
|
|
1133
1099
|
Trace.notifyEvent(child, 'childInLayoutRemovedFromNativeVisualTree');
|
|
1134
1100
|
}
|
|
1135
1101
|
}
|
|
1136
|
-
}
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
export { CustomLayoutView };
|
|
1140
|
-
var percentNotSupported = function (view, value) {
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
const percentNotSupported = (view, value) => {
|
|
1141
1105
|
throw new Error('PercentLength is not supported.');
|
|
1142
1106
|
};
|
|
1143
1107
|
function createNativePercentLengthProperty(options) {
|
|
1144
|
-
|
|
1145
|
-
|
|
1108
|
+
const { getter, setter, auto = 0 } = options;
|
|
1109
|
+
let setPixels, getPixels, setPercent;
|
|
1146
1110
|
if (getter) {
|
|
1147
1111
|
View.prototype[getter] = function () {
|
|
1148
1112
|
if (options) {
|
|
@@ -1151,13 +1115,13 @@ function createNativePercentLengthProperty(options) {
|
|
|
1151
1115
|
setPercent = options.setPercent || percentNotSupported;
|
|
1152
1116
|
options = null;
|
|
1153
1117
|
}
|
|
1154
|
-
|
|
1118
|
+
const value = getPixels(this.nativeViewProtected);
|
|
1155
1119
|
if (value == auto) {
|
|
1156
1120
|
// tslint:disable-line
|
|
1157
1121
|
return 'auto';
|
|
1158
1122
|
}
|
|
1159
1123
|
else {
|
|
1160
|
-
return { value
|
|
1124
|
+
return { value, unit: 'px' };
|
|
1161
1125
|
}
|
|
1162
1126
|
};
|
|
1163
1127
|
}
|
|
@@ -1189,7 +1153,7 @@ function createNativePercentLengthProperty(options) {
|
|
|
1189
1153
|
setPercent(this.nativeViewProtected, length.value);
|
|
1190
1154
|
}
|
|
1191
1155
|
else {
|
|
1192
|
-
throw new Error(
|
|
1156
|
+
throw new Error(`Unsupported PercentLength ${length}`);
|
|
1193
1157
|
}
|
|
1194
1158
|
};
|
|
1195
1159
|
}
|