@nativescript/core 9.0.0-next-11-05-2025-19118881386 → 9.0.0-next-11-12-2025-19288121507
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/application/application-common.d.ts +29 -10
- package/application/application-common.js +58 -5
- package/application/application-common.js.map +1 -1
- package/application/application-interfaces.d.ts +10 -0
- package/application/application-shims.d.ts +27 -0
- package/application/application-shims.js +27 -0
- package/application/application-shims.js.map +1 -1
- package/application/application.android.d.ts +3 -0
- package/application/application.android.js +348 -349
- package/application/application.android.js.map +1 -1
- package/application/application.ios.d.ts +3 -0
- package/application/application.ios.js +30 -19
- package/application/application.ios.js.map +1 -1
- package/config/config.interface.d.ts +21 -0
- package/connectivity/index.android.js +22 -22
- package/connectivity/index.android.js.map +1 -1
- package/core-types/index.d.ts +10 -1
- package/core-types/index.js +10 -1
- package/core-types/index.js.map +1 -1
- package/core-types/validators.js +12 -6
- package/core-types/validators.js.map +1 -1
- package/data/observable/index.d.ts +2 -1
- package/data/observable/index.js +31 -19
- package/data/observable/index.js.map +1 -1
- package/fps-meter/fps-native.ios.js +1 -1
- package/fps-meter/fps-native.ios.js.map +1 -1
- package/http/http-request/index.ios.js +1 -1
- package/http/http-request/index.ios.js.map +1 -1
- package/image-source/index.d.ts +2 -2
- package/package.json +1 -1
- package/platform/screen/index.d.ts +5 -0
- package/platforms/android/widgets-release.aar +0 -0
- package/timer/index.ios.js +1 -1
- package/timer/index.ios.js.map +1 -1
- package/ui/action-bar/index.android.js +18 -18
- package/ui/action-bar/index.android.js.map +1 -1
- package/ui/action-bar/index.ios.js +2 -4
- package/ui/action-bar/index.ios.js.map +1 -1
- package/ui/animation/index.ios.js +2 -3
- package/ui/animation/index.ios.js.map +1 -1
- package/ui/button/index.android.js +20 -20
- package/ui/button/index.android.js.map +1 -1
- package/ui/button/index.ios.d.ts +2 -1
- package/ui/button/index.ios.js +28 -10
- package/ui/button/index.ios.js.map +1 -1
- package/ui/core/control-state-change/index.ios.js +1 -1
- package/ui/core/control-state-change/index.ios.js.map +1 -1
- package/ui/core/view/index.android.d.ts +2 -0
- package/ui/core/view/index.android.js +221 -194
- package/ui/core/view/index.android.js.map +1 -1
- package/ui/core/view/index.d.ts +26 -3
- package/ui/core/view/index.ios.d.ts +3 -2
- package/ui/core/view/index.ios.js +25 -11
- package/ui/core/view/index.ios.js.map +1 -1
- package/ui/core/view/view-common.d.ts +10 -8
- package/ui/core/view/view-common.js +7 -0
- package/ui/core/view/view-common.js.map +1 -1
- package/ui/core/view/view-helper/index.d.ts +5 -0
- package/ui/core/view/view-helper/index.ios.d.ts +5 -4
- package/ui/core/view/view-helper/index.ios.js +20 -23
- package/ui/core/view/view-helper/index.ios.js.map +1 -1
- package/ui/core/view/view-helper/view-helper-common.js +7 -0
- package/ui/core/view/view-helper/view-helper-common.js.map +1 -1
- package/ui/date-picker/index.android.js +38 -38
- package/ui/date-picker/index.android.js.map +1 -1
- package/ui/date-picker/index.ios.js +1 -1
- package/ui/date-picker/index.ios.js.map +1 -1
- package/ui/editable-text-base/index.android.js +34 -34
- package/ui/editable-text-base/index.android.js.map +1 -1
- package/ui/frame/fragment.transitions.android.d.ts +2 -1
- package/ui/frame/fragment.transitions.android.js +106 -104
- package/ui/frame/fragment.transitions.android.js.map +1 -1
- package/ui/frame/fragment.transitions.d.ts +3 -2
- package/ui/frame/index.android.js +2 -2
- package/ui/frame/index.android.js.map +1 -1
- package/ui/frame/index.ios.d.ts +2 -1
- package/ui/frame/index.ios.js +83 -43
- package/ui/frame/index.ios.js.map +1 -1
- package/ui/gestures/index.android.js +129 -130
- package/ui/gestures/index.android.js.map +1 -1
- package/ui/gestures/index.ios.js +3 -5
- package/ui/gestures/index.ios.js.map +1 -1
- package/ui/gestures/touch-manager.js +32 -32
- package/ui/gestures/touch-manager.js.map +1 -1
- package/ui/image/index.android.js +19 -19
- package/ui/image/index.android.js.map +1 -1
- package/ui/image-cache/index.android.js +12 -14
- package/ui/image-cache/index.android.js.map +1 -1
- package/ui/image-cache/index.ios.js +6 -6
- package/ui/image-cache/index.ios.js.map +1 -1
- package/ui/index.d.ts +2 -1
- package/ui/index.js +1 -0
- package/ui/index.js.map +1 -1
- package/ui/label/index.android.js +4 -1
- package/ui/label/index.android.js.map +1 -1
- package/ui/label/index.ios.d.ts +2 -1
- package/ui/label/index.ios.js +12 -2
- package/ui/label/index.ios.js.map +1 -1
- package/ui/layouts/flexbox-layout/index.ios.js +3 -6
- package/ui/layouts/flexbox-layout/index.ios.js.map +1 -1
- package/ui/layouts/stack-layout/index.ios.js +6 -0
- package/ui/layouts/stack-layout/index.ios.js.map +1 -1
- package/ui/list-picker/index.android.js +35 -35
- package/ui/list-picker/index.android.js.map +1 -1
- package/ui/list-picker/index.ios.js +2 -2
- package/ui/list-picker/index.ios.js.map +1 -1
- package/ui/list-view/index.android.d.ts +26 -1
- package/ui/list-view/index.android.js +761 -143
- package/ui/list-view/index.android.js.map +1 -1
- package/ui/list-view/index.d.ts +127 -0
- package/ui/list-view/index.ios.d.ts +34 -2
- package/ui/list-view/index.ios.js +557 -21
- package/ui/list-view/index.ios.js.map +1 -1
- package/ui/list-view/list-view-common.d.ts +22 -1
- package/ui/list-view/list-view-common.js +85 -0
- package/ui/list-view/list-view-common.js.map +1 -1
- package/ui/page/index.ios.js +25 -64
- package/ui/page/index.ios.js.map +1 -1
- package/ui/scroll-view/index.d.ts +1 -1
- package/ui/scroll-view/index.ios.d.ts +2 -0
- package/ui/scroll-view/index.ios.js +31 -12
- package/ui/scroll-view/index.ios.js.map +1 -1
- package/ui/scroll-view/scroll-view-common.d.ts +3 -8
- package/ui/scroll-view/scroll-view-common.js +4 -4
- package/ui/scroll-view/scroll-view-common.js.map +1 -1
- package/ui/search-bar/index.android.js +48 -52
- package/ui/search-bar/index.android.js.map +1 -1
- package/ui/search-bar/index.ios.js +3 -6
- package/ui/search-bar/index.ios.js.map +1 -1
- package/ui/segmented-bar/index.android.js +56 -58
- package/ui/segmented-bar/index.android.js.map +1 -1
- package/ui/segmented-bar/index.ios.js +1 -1
- package/ui/segmented-bar/index.ios.js.map +1 -1
- package/ui/slider/index.android.js +23 -25
- package/ui/slider/index.android.js.map +1 -1
- package/ui/slider/index.ios.js +2 -2
- package/ui/slider/index.ios.js.map +1 -1
- package/ui/split-view/index.android.d.ts +4 -0
- package/ui/split-view/index.android.js +4 -0
- package/ui/split-view/index.android.js.map +1 -0
- package/ui/split-view/index.d.ts +11 -0
- package/ui/split-view/index.ios.d.ts +39 -0
- package/ui/split-view/index.ios.js +368 -0
- package/ui/split-view/index.ios.js.map +1 -0
- package/ui/split-view/split-view-common.d.ts +51 -0
- package/ui/split-view/split-view-common.js +111 -0
- package/ui/split-view/split-view-common.js.map +1 -0
- package/ui/styling/style/index.d.ts +2 -0
- package/ui/styling/style/index.js.map +1 -1
- package/ui/styling/style-properties.d.ts +1 -0
- package/ui/styling/style-properties.js +7 -0
- package/ui/styling/style-properties.js.map +1 -1
- package/ui/switch/index.android.js +18 -18
- package/ui/switch/index.android.js.map +1 -1
- package/ui/switch/index.ios.d.ts +1 -0
- package/ui/switch/index.ios.js +62 -12
- package/ui/switch/index.ios.js.map +1 -1
- package/ui/tab-view/index.android.js +185 -187
- package/ui/tab-view/index.android.js.map +1 -1
- package/ui/tab-view/index.d.ts +17 -1
- package/ui/tab-view/index.ios.d.ts +13 -5
- package/ui/tab-view/index.ios.js +253 -49
- package/ui/tab-view/index.ios.js.map +1 -1
- package/ui/tab-view/tab-view-common.d.ts +14 -0
- package/ui/tab-view/tab-view-common.js +15 -0
- package/ui/tab-view/tab-view-common.js.map +1 -1
- package/ui/text-base/index.android.d.ts +2 -1
- package/ui/text-base/index.android.js +133 -101
- package/ui/text-base/index.android.js.map +1 -1
- package/ui/text-base/index.d.ts +5 -0
- package/ui/text-base/index.ios.js +12 -18
- package/ui/text-base/index.ios.js.map +1 -1
- package/ui/text-base/text-base-common.d.ts +2 -1
- package/ui/text-base/text-base-common.js +1 -0
- package/ui/text-base/text-base-common.js.map +1 -1
- package/ui/text-field/index.ios.d.ts +2 -1
- package/ui/text-field/index.ios.js +9 -5
- package/ui/text-field/index.ios.js.map +1 -1
- package/ui/text-view/index.ios.d.ts +2 -1
- package/ui/text-view/index.ios.js +12 -7
- package/ui/text-view/index.ios.js.map +1 -1
- package/ui/time-picker/index.android.js +21 -21
- package/ui/time-picker/index.android.js.map +1 -1
- package/ui/time-picker/index.ios.js +1 -1
- package/ui/time-picker/index.ios.js.map +1 -1
- package/ui/transition/fade-transition.ios.js +5 -6
- package/ui/transition/fade-transition.ios.js.map +1 -1
- package/ui/transition/modal-transition.ios.js +19 -26
- package/ui/transition/modal-transition.ios.js.map +1 -1
- package/ui/transition/page-transition.android.js +3 -12
- package/ui/transition/page-transition.android.js.map +1 -1
- package/ui/transition/page-transition.ios.js +19 -25
- package/ui/transition/page-transition.ios.js.map +1 -1
- package/ui/transition/slide-transition.ios.js +5 -6
- package/ui/transition/slide-transition.ios.js.map +1 -1
- package/ui/web-view/index.android.js +58 -62
- package/ui/web-view/index.android.js.map +1 -1
- package/ui/web-view/index.ios.js +18 -18
- package/ui/web-view/index.ios.js.map +1 -1
- package/utils/common.d.ts +3 -1
- package/utils/common.js +9 -3
- package/utils/common.js.map +1 -1
- package/utils/index.d.ts +6 -0
- package/utils/layout-helper/index.android.d.ts +1 -0
- package/utils/layout-helper/index.android.js +9 -0
- package/utils/layout-helper/index.android.js.map +1 -1
- package/utils/layout-helper/index.d.ts +5 -0
- package/utils/layout-helper/index.ios.d.ts +1 -0
- package/utils/layout-helper/index.ios.js +4 -0
- package/utils/layout-helper/index.ios.js.map +1 -1
- package/utils/native-helper.ios.js +20 -20
- package/utils/native-helper.ios.js.map +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CoreTypes } from '../core-types';
|
|
1
2
|
import { profile } from '../profiling';
|
|
2
3
|
import { SDK_VERSION } from '../utils/constants';
|
|
3
4
|
import { android as androidUtils } from '../utils';
|
|
@@ -14,218 +15,203 @@ function initNativeScriptLifecycleCallbacks() {
|
|
|
14
15
|
if (NativeScriptLifecycleCallbacks_) {
|
|
15
16
|
return NativeScriptLifecycleCallbacks_;
|
|
16
17
|
}
|
|
17
|
-
var NativeScriptLifecycleCallbacksImpl =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
NativeScriptLifecycleCallbacksImpl.prototype.onActivityCreated = function (activity, savedInstanceState) {
|
|
25
|
-
// console.log('NativeScriptLifecycleCallbacks onActivityCreated');
|
|
26
|
-
this.setThemeOnLaunch(activity);
|
|
27
|
-
if (!Application.android.startActivity) {
|
|
28
|
-
Application.android.setStartActivity(activity);
|
|
18
|
+
var NativeScriptLifecycleCallbacksImpl = (function (_super) {
|
|
19
|
+
__extends(NativeScriptLifecycleCallbacksImpl, _super);
|
|
20
|
+
function NativeScriptLifecycleCallbacksImpl() {
|
|
21
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
22
|
+
_this.activitiesCount = 0;
|
|
23
|
+
return _this;
|
|
29
24
|
}
|
|
30
|
-
|
|
31
|
-
this.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (Application.hasListeners(Application.displayedEvent)) {
|
|
35
|
-
this.subscribeForGlobalLayout(activity);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
NativeScriptLifecycleCallbacksImpl.prototype.onActivityDestroyed = function (activity) {
|
|
39
|
-
// console.log('NativeScriptLifecycleCallbacks onActivityDestroyed');
|
|
40
|
-
if (activity === Application.android.foregroundActivity) {
|
|
41
|
-
Application.android.setForegroundActivity(undefined);
|
|
42
|
-
}
|
|
43
|
-
if (activity === this.nativescriptActivity) {
|
|
44
|
-
this.nativescriptActivity = undefined;
|
|
45
|
-
}
|
|
46
|
-
if (activity === Application.android.startActivity) {
|
|
47
|
-
Application.android.setStartActivity(undefined);
|
|
48
|
-
// Fallback for start activity when it is destroyed but we have a known nativescript activity
|
|
49
|
-
if (this.nativescriptActivity) {
|
|
50
|
-
Application.android.setStartActivity(this.nativescriptActivity);
|
|
25
|
+
NativeScriptLifecycleCallbacksImpl.prototype.onActivityCreated = function (activity, savedInstanceState) {
|
|
26
|
+
this.setThemeOnLaunch(activity);
|
|
27
|
+
if (!Application.android.startActivity) {
|
|
28
|
+
Application.android.setStartActivity(activity);
|
|
51
29
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
30
|
+
if (!this.nativescriptActivity && "isNativeScriptActivity" in activity) {
|
|
31
|
+
this.nativescriptActivity = activity;
|
|
32
|
+
}
|
|
33
|
+
this.notifyActivityCreated(activity, savedInstanceState);
|
|
34
|
+
if (Application.hasListeners(Application.displayedEvent)) {
|
|
35
|
+
this.subscribeForGlobalLayout(activity);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
NativeScriptLifecycleCallbacksImpl.prototype.onActivityDestroyed = function (activity) {
|
|
39
|
+
if (activity === Application.android.foregroundActivity) {
|
|
40
|
+
Application.android.setForegroundActivity(undefined);
|
|
41
|
+
}
|
|
42
|
+
if (activity === this.nativescriptActivity) {
|
|
43
|
+
this.nativescriptActivity = undefined;
|
|
44
|
+
}
|
|
45
|
+
if (activity === Application.android.startActivity) {
|
|
46
|
+
Application.android.setStartActivity(undefined);
|
|
47
|
+
if (this.nativescriptActivity) {
|
|
48
|
+
Application.android.setStartActivity(this.nativescriptActivity);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
Application.android.notify({
|
|
52
|
+
eventName: Application.android.activityDestroyedEvent,
|
|
53
|
+
object: Application.android,
|
|
67
54
|
activity: activity,
|
|
68
55
|
});
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
Application.android.notify({
|
|
82
|
-
eventName: Application.android.activityResumedEvent,
|
|
83
|
-
object: Application.android,
|
|
84
|
-
activity: activity,
|
|
85
|
-
});
|
|
86
|
-
};
|
|
87
|
-
NativeScriptLifecycleCallbacksImpl.prototype.onActivitySaveInstanceState = function (activity, bundle) {
|
|
88
|
-
// console.log('NativeScriptLifecycleCallbacks onActivitySaveInstanceState');
|
|
89
|
-
Application.android.notify({
|
|
90
|
-
eventName: Application.android.saveActivityStateEvent,
|
|
91
|
-
object: Application.android,
|
|
92
|
-
activity: activity,
|
|
93
|
-
bundle: bundle,
|
|
94
|
-
});
|
|
95
|
-
};
|
|
96
|
-
NativeScriptLifecycleCallbacksImpl.prototype.onActivityStarted = function (activity) {
|
|
97
|
-
// console.log('NativeScriptLifecycleCallbacks onActivityStarted');
|
|
98
|
-
this.activitiesCount++;
|
|
99
|
-
if (this.activitiesCount === 1) {
|
|
100
|
-
Application.android.setInBackground(false, {
|
|
101
|
-
// todo: deprecate event.android in favor of event.activity
|
|
102
|
-
android: activity,
|
|
56
|
+
gc();
|
|
57
|
+
};
|
|
58
|
+
NativeScriptLifecycleCallbacksImpl.prototype.onActivityPaused = function (activity) {
|
|
59
|
+
if ("isNativeScriptActivity" in activity) {
|
|
60
|
+
Application.setSuspended(true, {
|
|
61
|
+
android: activity,
|
|
62
|
+
activity: activity,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
Application.android.notify({
|
|
66
|
+
eventName: Application.android.activityPausedEvent,
|
|
67
|
+
object: Application.android,
|
|
103
68
|
activity: activity,
|
|
104
69
|
});
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
};
|
|
112
|
-
NativeScriptLifecycleCallbacksImpl.prototype.onActivityStopped = function (activity) {
|
|
113
|
-
// console.log('NativeScriptLifecycleCallbacks onActivityStopped');
|
|
114
|
-
this.activitiesCount--;
|
|
115
|
-
if (this.activitiesCount === 0) {
|
|
116
|
-
Application.android.setInBackground(true, {
|
|
117
|
-
// todo: deprecate event.android in favor of event.activity
|
|
118
|
-
android: activity,
|
|
70
|
+
};
|
|
71
|
+
NativeScriptLifecycleCallbacksImpl.prototype.onActivityResumed = function (activity) {
|
|
72
|
+
Application.android.setForegroundActivity(activity);
|
|
73
|
+
Application.android.notify({
|
|
74
|
+
eventName: Application.android.activityResumedEvent,
|
|
75
|
+
object: Application.android,
|
|
119
76
|
activity: activity,
|
|
120
77
|
});
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
78
|
+
};
|
|
79
|
+
NativeScriptLifecycleCallbacksImpl.prototype.onActivitySaveInstanceState = function (activity, bundle) {
|
|
80
|
+
Application.android.notify({
|
|
81
|
+
eventName: Application.android.saveActivityStateEvent,
|
|
82
|
+
object: Application.android,
|
|
83
|
+
activity: activity,
|
|
84
|
+
bundle: bundle,
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
NativeScriptLifecycleCallbacksImpl.prototype.onActivityStarted = function (activity) {
|
|
88
|
+
this.activitiesCount++;
|
|
89
|
+
if (this.activitiesCount === 1) {
|
|
90
|
+
Application.android.setInBackground(false, {
|
|
91
|
+
android: activity,
|
|
92
|
+
activity: activity,
|
|
93
|
+
});
|
|
135
94
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
var rootView = activity.getWindow().getDecorView().getRootView();
|
|
148
|
-
// store the listener not to trigger GC collection before collecting the method
|
|
149
|
-
global.onGlobalLayoutListener = new android.view.ViewTreeObserver.OnGlobalLayoutListener({
|
|
150
|
-
onGlobalLayout: function () {
|
|
151
|
-
Application.android.notify({
|
|
152
|
-
eventName: Application.displayedEvent,
|
|
153
|
-
object: Application,
|
|
154
|
-
android: Application.android,
|
|
95
|
+
Application.android.notify({
|
|
96
|
+
eventName: Application.android.activityStartedEvent,
|
|
97
|
+
object: Application.android,
|
|
98
|
+
activity: activity,
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
NativeScriptLifecycleCallbacksImpl.prototype.onActivityStopped = function (activity) {
|
|
102
|
+
this.activitiesCount--;
|
|
103
|
+
if (this.activitiesCount === 0) {
|
|
104
|
+
Application.android.setInBackground(true, {
|
|
105
|
+
android: activity,
|
|
155
106
|
activity: activity,
|
|
156
107
|
});
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
108
|
+
}
|
|
109
|
+
Application.android.notify({
|
|
110
|
+
eventName: Application.android.activityStoppedEvent,
|
|
111
|
+
object: Application.android,
|
|
112
|
+
activity: activity,
|
|
113
|
+
});
|
|
114
|
+
// This is done to ensure proper timing for the event to be raised
|
|
115
|
+
};
|
|
116
|
+
NativeScriptLifecycleCallbacksImpl.prototype.setThemeOnLaunch = function (activity) {
|
|
117
|
+
var activityInfo = activity.getPackageManager().getActivityInfo(activity.getComponentName(), android.content.pm.PackageManager.GET_META_DATA);
|
|
118
|
+
if (activityInfo.metaData) {
|
|
119
|
+
var setThemeOnLaunch = activityInfo.metaData.getInt("SET_THEME_ON_LAUNCH", -1);
|
|
120
|
+
if (setThemeOnLaunch !== -1) {
|
|
121
|
+
activity.setTheme(setThemeOnLaunch);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
NativeScriptLifecycleCallbacksImpl.prototype.notifyActivityCreated = function (activity, bundle) {
|
|
126
|
+
Application.android.notify({
|
|
127
|
+
eventName: Application.android.activityCreatedEvent,
|
|
128
|
+
object: Application.android,
|
|
129
|
+
activity: activity,
|
|
130
|
+
bundle: bundle,
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
NativeScriptLifecycleCallbacksImpl.prototype.subscribeForGlobalLayout = function (activity) {
|
|
134
|
+
var rootView = activity.getWindow().getDecorView().getRootView();
|
|
135
|
+
global.onGlobalLayoutListener = new android.view.ViewTreeObserver.OnGlobalLayoutListener({
|
|
136
|
+
onGlobalLayout: function () {
|
|
137
|
+
Application.android.notify({
|
|
138
|
+
eventName: Application.displayedEvent,
|
|
139
|
+
object: Application,
|
|
140
|
+
android: Application.android,
|
|
141
|
+
activity: activity,
|
|
142
|
+
});
|
|
143
|
+
var viewTreeObserver = rootView.getViewTreeObserver();
|
|
144
|
+
viewTreeObserver.removeOnGlobalLayoutListener(global.onGlobalLayoutListener);
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
rootView.getViewTreeObserver().addOnGlobalLayoutListener(global.onGlobalLayoutListener);
|
|
148
|
+
};
|
|
149
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11;
|
|
150
|
+
__decorate([
|
|
151
|
+
profile,
|
|
152
|
+
__metadata("design:type", Function),
|
|
153
|
+
__metadata("design:paramtypes", [typeof (_c = typeof androidx !== "undefined" && (_a = androidx.appcompat) !== void 0 && (_b = _a.app) !== void 0 && _b.AppCompatActivity) === "function" ? _c : Object, typeof (_e = typeof android !== "undefined" && (_d = android.os) !== void 0 && _d.Bundle) === "function" ? _e : Object]),
|
|
154
|
+
__metadata("design:returntype", void 0)
|
|
155
|
+
], NativeScriptLifecycleCallbacksImpl.prototype, "onActivityCreated", null);
|
|
156
|
+
__decorate([
|
|
157
|
+
profile,
|
|
158
|
+
__metadata("design:type", Function),
|
|
159
|
+
__metadata("design:paramtypes", [typeof (_h = typeof androidx !== "undefined" && (_f = androidx.appcompat) !== void 0 && (_g = _f.app) !== void 0 && _g.AppCompatActivity) === "function" ? _h : Object]),
|
|
160
|
+
__metadata("design:returntype", void 0)
|
|
161
|
+
], NativeScriptLifecycleCallbacksImpl.prototype, "onActivityDestroyed", null);
|
|
162
|
+
__decorate([
|
|
163
|
+
profile,
|
|
164
|
+
__metadata("design:type", Function),
|
|
165
|
+
__metadata("design:paramtypes", [typeof (_l = typeof androidx !== "undefined" && (_j = androidx.appcompat) !== void 0 && (_k = _j.app) !== void 0 && _k.AppCompatActivity) === "function" ? _l : Object]),
|
|
166
|
+
__metadata("design:returntype", void 0)
|
|
167
|
+
], NativeScriptLifecycleCallbacksImpl.prototype, "onActivityPaused", null);
|
|
168
|
+
__decorate([
|
|
169
|
+
profile,
|
|
170
|
+
__metadata("design:type", Function),
|
|
171
|
+
__metadata("design:paramtypes", [typeof (_p = typeof androidx !== "undefined" && (_m = androidx.appcompat) !== void 0 && (_o = _m.app) !== void 0 && _o.AppCompatActivity) === "function" ? _p : Object]),
|
|
172
|
+
__metadata("design:returntype", void 0)
|
|
173
|
+
], NativeScriptLifecycleCallbacksImpl.prototype, "onActivityResumed", null);
|
|
174
|
+
__decorate([
|
|
175
|
+
profile,
|
|
176
|
+
__metadata("design:type", Function),
|
|
177
|
+
__metadata("design:paramtypes", [typeof (_s = typeof androidx !== "undefined" && (_q = androidx.appcompat) !== void 0 && (_r = _q.app) !== void 0 && _r.AppCompatActivity) === "function" ? _s : Object, typeof (_u = typeof android !== "undefined" && (_t = android.os) !== void 0 && _t.Bundle) === "function" ? _u : Object]),
|
|
178
|
+
__metadata("design:returntype", void 0)
|
|
179
|
+
], NativeScriptLifecycleCallbacksImpl.prototype, "onActivitySaveInstanceState", null);
|
|
180
|
+
__decorate([
|
|
181
|
+
profile,
|
|
182
|
+
__metadata("design:type", Function),
|
|
183
|
+
__metadata("design:paramtypes", [typeof (_x = typeof androidx !== "undefined" && (_v = androidx.appcompat) !== void 0 && (_w = _v.app) !== void 0 && _w.AppCompatActivity) === "function" ? _x : Object]),
|
|
184
|
+
__metadata("design:returntype", void 0)
|
|
185
|
+
], NativeScriptLifecycleCallbacksImpl.prototype, "onActivityStarted", null);
|
|
186
|
+
__decorate([
|
|
187
|
+
profile,
|
|
188
|
+
__metadata("design:type", Function),
|
|
189
|
+
__metadata("design:paramtypes", [typeof (_0 = typeof androidx !== "undefined" && (_y = androidx.appcompat) !== void 0 && (_z = _y.app) !== void 0 && _z.AppCompatActivity) === "function" ? _0 : Object]),
|
|
190
|
+
__metadata("design:returntype", void 0)
|
|
191
|
+
], NativeScriptLifecycleCallbacksImpl.prototype, "onActivityStopped", null);
|
|
192
|
+
__decorate([
|
|
193
|
+
profile,
|
|
194
|
+
__metadata("design:type", Function),
|
|
195
|
+
__metadata("design:paramtypes", [typeof (_3 = typeof androidx !== "undefined" && (_1 = androidx.appcompat) !== void 0 && (_2 = _1.app) !== void 0 && _2.AppCompatActivity) === "function" ? _3 : Object]),
|
|
196
|
+
__metadata("design:returntype", void 0)
|
|
197
|
+
], NativeScriptLifecycleCallbacksImpl.prototype, "setThemeOnLaunch", null);
|
|
198
|
+
__decorate([
|
|
199
|
+
profile,
|
|
200
|
+
__metadata("design:type", Function),
|
|
201
|
+
__metadata("design:paramtypes", [typeof (_6 = typeof androidx !== "undefined" && (_4 = androidx.appcompat) !== void 0 && (_5 = _4.app) !== void 0 && _5.AppCompatActivity) === "function" ? _6 : Object, typeof (_8 = typeof android !== "undefined" && (_7 = android.os) !== void 0 && _7.Bundle) === "function" ? _8 : Object]),
|
|
202
|
+
__metadata("design:returntype", void 0)
|
|
203
|
+
], NativeScriptLifecycleCallbacksImpl.prototype, "notifyActivityCreated", null);
|
|
204
|
+
__decorate([
|
|
205
|
+
profile,
|
|
206
|
+
__metadata("design:type", Function),
|
|
207
|
+
__metadata("design:paramtypes", [typeof (_11 = typeof androidx !== "undefined" && (_9 = androidx.appcompat) !== void 0 && (_10 = _9.app) !== void 0 && _10.AppCompatActivity) === "function" ? _11 : Object]),
|
|
208
|
+
__metadata("design:returntype", void 0)
|
|
209
|
+
], NativeScriptLifecycleCallbacksImpl.prototype, "subscribeForGlobalLayout", null);
|
|
210
|
+
NativeScriptLifecycleCallbacksImpl = __decorate([
|
|
211
|
+
JavaProxy("org.nativescript.NativeScriptLifecycleCallbacks")
|
|
212
|
+
], NativeScriptLifecycleCallbacksImpl);
|
|
213
|
+
return NativeScriptLifecycleCallbacksImpl;
|
|
214
|
+
}(android.app.Application.ActivityLifecycleCallbacks));
|
|
229
215
|
NativeScriptLifecycleCallbacks_ = NativeScriptLifecycleCallbacksImpl;
|
|
230
216
|
return NativeScriptLifecycleCallbacks_;
|
|
231
217
|
}
|
|
@@ -234,68 +220,67 @@ function initNativeScriptComponentCallbacks() {
|
|
|
234
220
|
if (NativeScriptComponentCallbacks_) {
|
|
235
221
|
return NativeScriptComponentCallbacks_;
|
|
236
222
|
}
|
|
237
|
-
var NativeScriptComponentCallbacksImpl =
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
}(android.content.ComponentCallbacks2));
|
|
223
|
+
var NativeScriptComponentCallbacksImpl = (function (_super) {
|
|
224
|
+
__extends(NativeScriptComponentCallbacksImpl, _super);
|
|
225
|
+
function NativeScriptComponentCallbacksImpl() {
|
|
226
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
227
|
+
}
|
|
228
|
+
NativeScriptComponentCallbacksImpl.prototype.onLowMemory = function () {
|
|
229
|
+
gc();
|
|
230
|
+
java.lang.System.gc();
|
|
231
|
+
Application.notify({
|
|
232
|
+
eventName: Application.lowMemoryEvent,
|
|
233
|
+
object: Application,
|
|
234
|
+
android: this,
|
|
235
|
+
});
|
|
236
|
+
};
|
|
237
|
+
NativeScriptComponentCallbacksImpl.prototype.onTrimMemory = function (level) {
|
|
238
|
+
};
|
|
239
|
+
NativeScriptComponentCallbacksImpl.prototype.onConfigurationChanged = function (newConfiguration) {
|
|
240
|
+
Application.android.onConfigurationChanged(newConfiguration);
|
|
241
|
+
};
|
|
242
|
+
var _a, _b, _c;
|
|
243
|
+
__decorate([
|
|
244
|
+
profile,
|
|
245
|
+
__metadata("design:type", Function),
|
|
246
|
+
__metadata("design:paramtypes", []),
|
|
247
|
+
__metadata("design:returntype", void 0)
|
|
248
|
+
], NativeScriptComponentCallbacksImpl.prototype, "onLowMemory", null);
|
|
249
|
+
__decorate([
|
|
250
|
+
profile,
|
|
251
|
+
__metadata("design:type", Function),
|
|
252
|
+
__metadata("design:paramtypes", [Number]),
|
|
253
|
+
__metadata("design:returntype", void 0)
|
|
254
|
+
], NativeScriptComponentCallbacksImpl.prototype, "onTrimMemory", null);
|
|
255
|
+
__decorate([
|
|
256
|
+
profile,
|
|
257
|
+
__metadata("design:type", Function),
|
|
258
|
+
__metadata("design:paramtypes", [typeof (_c = typeof android !== "undefined" && (_a = android.content) !== void 0 && (_b = _a.res) !== void 0 && _b.Configuration) === "function" ? _c : Object]),
|
|
259
|
+
__metadata("design:returntype", void 0)
|
|
260
|
+
], NativeScriptComponentCallbacksImpl.prototype, "onConfigurationChanged", null);
|
|
261
|
+
NativeScriptComponentCallbacksImpl = __decorate([
|
|
262
|
+
JavaProxy("org.nativescript.NativeScriptComponentCallbacks")
|
|
263
|
+
], NativeScriptComponentCallbacksImpl);
|
|
264
|
+
return NativeScriptComponentCallbacksImpl;
|
|
265
|
+
}(android.content.ComponentCallbacks2));
|
|
281
266
|
NativeScriptComponentCallbacks_ = NativeScriptComponentCallbacksImpl;
|
|
282
267
|
return NativeScriptComponentCallbacks_;
|
|
283
268
|
}
|
|
284
269
|
const BroadcastReceiver = lazy(() => {
|
|
285
|
-
var BroadcastReceiverImpl =
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
}
|
|
292
|
-
BroadcastReceiverImpl.prototype.onReceive = function (context, intent) {
|
|
293
|
-
if (this._onReceiveCallback) {
|
|
294
|
-
this._onReceiveCallback(context, intent);
|
|
270
|
+
var BroadcastReceiverImpl = (function (_super) {
|
|
271
|
+
__extends(BroadcastReceiverImpl, _super);
|
|
272
|
+
function BroadcastReceiverImpl(onReceiveCallback) {
|
|
273
|
+
var _this = _super.call(this) || this;
|
|
274
|
+
_this._onReceiveCallback = onReceiveCallback;
|
|
275
|
+
return global.__native(_this);
|
|
295
276
|
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
277
|
+
BroadcastReceiverImpl.prototype.onReceive = function (context, intent) {
|
|
278
|
+
if (this._onReceiveCallback) {
|
|
279
|
+
this._onReceiveCallback(context, intent);
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
return BroadcastReceiverImpl;
|
|
283
|
+
}(android.content.BroadcastReceiver));
|
|
299
284
|
return BroadcastReceiverImpl;
|
|
300
285
|
});
|
|
301
286
|
export class AndroidApplication extends ApplicationCommon {
|
|
@@ -342,6 +327,7 @@ export class AndroidApplication extends ApplicationCommon {
|
|
|
342
327
|
onConfigurationChanged(configuration) {
|
|
343
328
|
this.setOrientation(this.getOrientationValue(configuration));
|
|
344
329
|
this.setSystemAppearance(this.getSystemAppearanceValue(configuration));
|
|
330
|
+
this.setLayoutDirection(this.getLayoutDirectionValue(configuration));
|
|
345
331
|
}
|
|
346
332
|
getNativeApplication() {
|
|
347
333
|
let nativeApp = this.nativeApp;
|
|
@@ -499,6 +485,20 @@ export class AndroidApplication extends ApplicationCommon {
|
|
|
499
485
|
return 'light';
|
|
500
486
|
}
|
|
501
487
|
}
|
|
488
|
+
getLayoutDirection() {
|
|
489
|
+
const resources = this.context.getResources();
|
|
490
|
+
const configuration = resources.getConfiguration();
|
|
491
|
+
return this.getLayoutDirectionValue(configuration);
|
|
492
|
+
}
|
|
493
|
+
getLayoutDirectionValue(configuration) {
|
|
494
|
+
const layoutDirection = configuration.getLayoutDirection();
|
|
495
|
+
switch (layoutDirection) {
|
|
496
|
+
case android.view.View.LAYOUT_DIRECTION_LTR:
|
|
497
|
+
return CoreTypes.LayoutDirection.ltr;
|
|
498
|
+
case android.view.View.LAYOUT_DIRECTION_RTL:
|
|
499
|
+
return CoreTypes.LayoutDirection.rtl;
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
502
|
getOrientation() {
|
|
503
503
|
const resources = this.context.getResources();
|
|
504
504
|
const configuration = resources.getConfiguration();
|
|
@@ -857,117 +857,116 @@ function ensureNativeClasses() {
|
|
|
857
857
|
]);
|
|
858
858
|
clickableRolesMap = new Set([AccessibilityRole.Button, AccessibilityRole.ImageButton]);
|
|
859
859
|
const ignoreRoleTypesForTrace = new Set([AccessibilityRole.Header, AccessibilityRole.Link, AccessibilityRole.None, AccessibilityRole.Summary]);
|
|
860
|
-
var TNSAccessibilityDelegateImpl =
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
}
|
|
866
|
-
TNSAccessibilityDelegateImpl.prototype.getTnsView = function (androidView) {
|
|
867
|
-
var _a;
|
|
868
|
-
var view = (_a = androidViewToTNSView.get(androidView)) === null || _a === void 0 ? void 0 : _a.get();
|
|
869
|
-
if (!view) {
|
|
870
|
-
androidViewToTNSView.delete(androidView);
|
|
871
|
-
return null;
|
|
872
|
-
}
|
|
873
|
-
return view;
|
|
874
|
-
};
|
|
875
|
-
TNSAccessibilityDelegateImpl.prototype.onInitializeAccessibilityNodeInfo = function (host, info) {
|
|
876
|
-
_super.prototype.onInitializeAccessibilityNodeInfo.call(this, host, info);
|
|
877
|
-
var view = this.getTnsView(host);
|
|
878
|
-
if (!view) {
|
|
879
|
-
if (Trace.isEnabled()) {
|
|
880
|
-
Trace.write("onInitializeAccessibilityNodeInfo ".concat(host, " ").concat(info, " no tns-view"), Trace.categories.Accessibility);
|
|
881
|
-
}
|
|
882
|
-
return;
|
|
883
|
-
}
|
|
884
|
-
// Set resource id that can be used with test frameworks without polluting the content description.
|
|
885
|
-
var id = host.getTag(androidUtils.resources.getId(":id/nativescript_accessibility_id"));
|
|
886
|
-
if (id != null) {
|
|
887
|
-
info.setViewIdResourceName(id);
|
|
860
|
+
var TNSAccessibilityDelegateImpl = (function (_super) {
|
|
861
|
+
__extends(TNSAccessibilityDelegateImpl, _super);
|
|
862
|
+
function TNSAccessibilityDelegateImpl() {
|
|
863
|
+
var _this = _super.call(this) || this;
|
|
864
|
+
return global.__native(_this);
|
|
888
865
|
}
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
var
|
|
892
|
-
if (
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
if (Trace.isEnabled()) {
|
|
896
|
-
Trace.write("".concat(view, ".accessibilityRole = \"").concat(accessibilityRole, "\" is mapped to \"").concat(androidClassName, "\" (was ").concat(oldClassName, "). ").concat(info.getClassName()), Trace.categories.Accessibility);
|
|
897
|
-
}
|
|
866
|
+
TNSAccessibilityDelegateImpl.prototype.getTnsView = function (androidView) {
|
|
867
|
+
var _a;
|
|
868
|
+
var view = (_a = androidViewToTNSView.get(androidView)) === null || _a === void 0 ? void 0 : _a.get();
|
|
869
|
+
if (!view) {
|
|
870
|
+
androidViewToTNSView.delete(androidView);
|
|
871
|
+
return null;
|
|
898
872
|
}
|
|
899
|
-
|
|
873
|
+
return view;
|
|
874
|
+
};
|
|
875
|
+
TNSAccessibilityDelegateImpl.prototype.onInitializeAccessibilityNodeInfo = function (host, info) {
|
|
876
|
+
_super.prototype.onInitializeAccessibilityNodeInfo.call(this, host, info);
|
|
877
|
+
var view = this.getTnsView(host);
|
|
878
|
+
if (!view) {
|
|
900
879
|
if (Trace.isEnabled()) {
|
|
901
|
-
Trace.write("".concat(
|
|
880
|
+
Trace.write("onInitializeAccessibilityNodeInfo ".concat(host, " ").concat(info, " no tns-view"), Trace.categories.Accessibility);
|
|
902
881
|
}
|
|
882
|
+
return;
|
|
903
883
|
}
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
}
|
|
908
|
-
info.setClickable(true);
|
|
884
|
+
var id = host.getTag(androidUtils.resources.getId(":id/nativescript_accessibility_id"));
|
|
885
|
+
if (id != null) {
|
|
886
|
+
info.setViewIdResourceName(id);
|
|
909
887
|
}
|
|
910
|
-
|
|
911
|
-
|
|
888
|
+
var accessibilityRole = view.accessibilityRole;
|
|
889
|
+
if (accessibilityRole) {
|
|
890
|
+
var androidClassName = RoleTypeMap.get(accessibilityRole);
|
|
891
|
+
if (androidClassName) {
|
|
892
|
+
var oldClassName = info.getClassName() || (SDK_VERSION >= 28 && host.getAccessibilityClassName()) || null;
|
|
893
|
+
info.setClassName(androidClassName);
|
|
912
894
|
if (Trace.isEnabled()) {
|
|
913
|
-
Trace.write("
|
|
895
|
+
Trace.write("".concat(view, ".accessibilityRole = \"").concat(accessibilityRole, "\" is mapped to \"").concat(androidClassName, "\" (was ").concat(oldClassName, "). ").concat(info.getClassName()), Trace.categories.Accessibility);
|
|
914
896
|
}
|
|
915
|
-
info.setHeading(true);
|
|
916
897
|
}
|
|
917
|
-
else if (
|
|
898
|
+
else if (!ignoreRoleTypesForTrace.has(accessibilityRole)) {
|
|
918
899
|
if (Trace.isEnabled()) {
|
|
919
|
-
Trace.write("
|
|
900
|
+
Trace.write("".concat(view, ".accessibilityRole = \"").concat(accessibilityRole, "\" is unknown"), Trace.categories.Accessibility);
|
|
920
901
|
}
|
|
921
|
-
info.setHeading(true);
|
|
922
902
|
}
|
|
923
|
-
|
|
903
|
+
if (clickableRolesMap.has(accessibilityRole)) {
|
|
924
904
|
if (Trace.isEnabled()) {
|
|
925
|
-
Trace.write("onInitializeAccessibilityNodeInfo ".concat(view, " - set
|
|
905
|
+
Trace.write("onInitializeAccessibilityNodeInfo ".concat(view, " - set clickable role=").concat(accessibilityRole), Trace.categories.Accessibility);
|
|
926
906
|
}
|
|
927
|
-
info.
|
|
907
|
+
info.setClickable(true);
|
|
928
908
|
}
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
909
|
+
if (SDK_VERSION >= 28) {
|
|
910
|
+
if (accessibilityRole === AccessibilityRole.Header) {
|
|
911
|
+
if (Trace.isEnabled()) {
|
|
912
|
+
Trace.write("onInitializeAccessibilityNodeInfo ".concat(view, " - set heading role=").concat(accessibilityRole), Trace.categories.Accessibility);
|
|
913
|
+
}
|
|
914
|
+
info.setHeading(true);
|
|
915
|
+
}
|
|
916
|
+
else if (host.isAccessibilityHeading()) {
|
|
917
|
+
if (Trace.isEnabled()) {
|
|
918
|
+
Trace.write("onInitializeAccessibilityNodeInfo ".concat(view, " - set heading from host"), Trace.categories.Accessibility);
|
|
919
|
+
}
|
|
920
|
+
info.setHeading(true);
|
|
921
|
+
}
|
|
922
|
+
else {
|
|
923
|
+
if (Trace.isEnabled()) {
|
|
924
|
+
Trace.write("onInitializeAccessibilityNodeInfo ".concat(view, " - set not heading"), Trace.categories.Accessibility);
|
|
925
|
+
}
|
|
926
|
+
info.setHeading(false);
|
|
936
927
|
}
|
|
937
|
-
info.setCheckable(true);
|
|
938
|
-
info.setChecked(view.accessibilityState === AccessibilityState.Checked);
|
|
939
|
-
break;
|
|
940
928
|
}
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
929
|
+
switch (accessibilityRole) {
|
|
930
|
+
case AccessibilityRole.Switch:
|
|
931
|
+
case AccessibilityRole.RadioButton:
|
|
932
|
+
case AccessibilityRole.Checkbox: {
|
|
933
|
+
if (Trace.isEnabled()) {
|
|
934
|
+
Trace.write("onInitializeAccessibilityNodeInfo ".concat(view, " - set checkable and check=").concat(view.accessibilityState === AccessibilityState.Checked), Trace.categories.Accessibility);
|
|
935
|
+
}
|
|
936
|
+
info.setCheckable(true);
|
|
937
|
+
info.setChecked(view.accessibilityState === AccessibilityState.Checked);
|
|
938
|
+
break;
|
|
939
|
+
}
|
|
940
|
+
default: {
|
|
941
|
+
if (Trace.isEnabled()) {
|
|
942
|
+
Trace.write("onInitializeAccessibilityNodeInfo ".concat(view, " - set enabled=").concat(view.accessibilityState !== AccessibilityState.Disabled, " and selected=").concat(view.accessibilityState === AccessibilityState.Selected), Trace.categories.Accessibility);
|
|
943
|
+
}
|
|
944
|
+
info.setEnabled(view.accessibilityState !== AccessibilityState.Disabled);
|
|
945
|
+
info.setSelected(view.accessibilityState === AccessibilityState.Selected);
|
|
946
|
+
break;
|
|
944
947
|
}
|
|
945
|
-
info.setEnabled(view.accessibilityState !== AccessibilityState.Disabled);
|
|
946
|
-
info.setSelected(view.accessibilityState === AccessibilityState.Selected);
|
|
947
|
-
break;
|
|
948
948
|
}
|
|
949
949
|
}
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
}
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
}
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
}(AccessibilityDelegate));
|
|
950
|
+
if (view.accessible) {
|
|
951
|
+
info.setFocusable(true);
|
|
952
|
+
}
|
|
953
|
+
};
|
|
954
|
+
TNSAccessibilityDelegateImpl.prototype.sendAccessibilityEvent = function (host, eventType) {
|
|
955
|
+
_super.prototype.sendAccessibilityEvent.call(this, host, eventType);
|
|
956
|
+
var view = this.getTnsView(host);
|
|
957
|
+
if (!view) {
|
|
958
|
+
console.log("skip - ".concat(host, " - ").concat(accessibilityEventTypeMap.get(eventType)));
|
|
959
|
+
return;
|
|
960
|
+
}
|
|
961
|
+
try {
|
|
962
|
+
accessibilityEventHelper(view, eventType);
|
|
963
|
+
}
|
|
964
|
+
catch (err) {
|
|
965
|
+
console.error(err);
|
|
966
|
+
}
|
|
967
|
+
};
|
|
968
|
+
return TNSAccessibilityDelegateImpl;
|
|
969
|
+
}(AccessibilityDelegate));
|
|
971
970
|
TNSAccessibilityDelegate = new TNSAccessibilityDelegateImpl();
|
|
972
971
|
accessibilityEventMap = new Map([
|
|
973
972
|
/**
|