@nativescript/core 9.0.0-alpha.5 → 9.0.0-next-07-20-2025-16403500407

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.
Files changed (481) hide show
  1. package/accessibility/accessibility-common.d.ts +0 -264
  2. package/accessibility/accessibility-common.js +0 -352
  3. package/accessibility/accessibility-common.js.map +1 -1
  4. package/accessibility/accessibility-css-helper.d.ts +1 -0
  5. package/accessibility/accessibility-css-helper.js +101 -0
  6. package/accessibility/accessibility-css-helper.js.map +1 -0
  7. package/accessibility/accessibility-properties.d.ts +1 -1
  8. package/accessibility/accessibility-properties.js +2 -2
  9. package/accessibility/accessibility-properties.js.map +1 -1
  10. package/accessibility/accessibility-service-common.d.ts +8 -0
  11. package/accessibility/accessibility-service-common.js +26 -0
  12. package/accessibility/accessibility-service-common.js.map +1 -0
  13. package/accessibility/accessibility-service.android.d.ts +6 -0
  14. package/accessibility/accessibility-service.android.js +103 -0
  15. package/accessibility/accessibility-service.android.js.map +1 -0
  16. package/accessibility/accessibility-service.d.ts +10 -0
  17. package/accessibility/accessibility-service.ios.d.ts +6 -0
  18. package/accessibility/accessibility-service.ios.js +61 -0
  19. package/accessibility/accessibility-service.ios.js.map +1 -0
  20. package/accessibility/accessibility-types.d.ts +224 -0
  21. package/accessibility/accessibility-types.js +222 -0
  22. package/accessibility/accessibility-types.js.map +1 -0
  23. package/accessibility/font-scale-common.d.ts +7 -0
  24. package/accessibility/font-scale-common.js +14 -0
  25. package/accessibility/font-scale-common.js.map +1 -0
  26. package/accessibility/font-scale.android.d.ts +5 -0
  27. package/accessibility/font-scale.android.js +55 -0
  28. package/accessibility/font-scale.android.js.map +1 -0
  29. package/accessibility/font-scale.d.ts +9 -0
  30. package/accessibility/font-scale.ios.d.ts +5 -0
  31. package/accessibility/font-scale.ios.js +89 -0
  32. package/accessibility/font-scale.ios.js.map +1 -0
  33. package/accessibility/index.android.d.ts +10 -0
  34. package/accessibility/index.android.js +577 -0
  35. package/accessibility/index.android.js.map +1 -0
  36. package/accessibility/index.d.ts +36 -0
  37. package/accessibility/index.ios.d.ts +9 -0
  38. package/accessibility/index.ios.js +229 -0
  39. package/accessibility/index.ios.js.map +1 -0
  40. package/application/application-common.d.ts +8 -6
  41. package/application/application-common.js +14 -21
  42. package/application/application-common.js.map +1 -1
  43. package/application/application-interfaces.d.ts +3 -2
  44. package/application/application.android.d.ts +7 -14
  45. package/application/application.android.js +75 -754
  46. package/application/application.android.js.map +1 -1
  47. package/application/application.d.ts +0 -25
  48. package/application/application.ios.d.ts +18 -16
  49. package/application/application.ios.js +45 -455
  50. package/application/application.ios.js.map +1 -1
  51. package/application-settings/index.android.js +2 -2
  52. package/application-settings/index.android.js.map +1 -1
  53. package/cli-hooks/{before-checkForChanges.mjs → before-checkForChanges.js} +6 -6
  54. package/cli-hooks/postinstall.js +2 -0
  55. package/cli-hooks/preuninstall.js +2 -0
  56. package/color/color-common.d.ts +19 -18
  57. package/color/color-common.js +14 -13
  58. package/color/color-common.js.map +1 -1
  59. package/color/index.ios.d.ts +1 -2
  60. package/color/index.ios.js.map +1 -1
  61. package/connectivity/index.android.js +4 -5
  62. package/connectivity/index.android.js.map +1 -1
  63. package/core-types/index.d.ts +1 -1
  64. package/core-types/index.js +2 -2
  65. package/core-types/index.js.map +1 -1
  66. package/css/css-tree-parser.js +21 -17
  67. package/css/css-tree-parser.js.map +1 -1
  68. package/css/lib/parse/index.js +577 -475
  69. package/css/package.json +36 -0
  70. package/css/reworkcss.d.ts +28 -25
  71. package/css/reworkcss.js +1 -5
  72. package/css-mediaquery/index.js +1 -1
  73. package/css-mediaquery/index.js.map +1 -1
  74. package/css-value/package.json +23 -0
  75. package/css-value/reworkcss-value.d.ts +8 -31
  76. package/css-value/reworkcss-value.js +111 -89
  77. package/debugger/devtools-elements-interfaces.d.ts +1 -1
  78. package/debugger/devtools-elements.common.js +8 -17
  79. package/debugger/devtools-elements.common.js.map +1 -1
  80. package/debugger/devtools-elements.js +1 -1
  81. package/debugger/devtools-elements.js.map +1 -1
  82. package/debugger/dom-node.d.ts +27 -0
  83. package/debugger/{dom-types.js → dom-node.js} +9 -11
  84. package/debugger/dom-node.js.map +1 -0
  85. package/debugger/webinspector-css.d.ts +18 -18
  86. package/debugger/webinspector-css.js +1 -1
  87. package/debugger/webinspector-css.js.map +1 -1
  88. package/debugger/webinspector-dom.d.ts +15 -15
  89. package/debugger/webinspector-dom.js +1 -1
  90. package/debugger/webinspector-dom.js.map +1 -1
  91. package/debugger/webinspector-network.android.d.ts +9 -9
  92. package/debugger/webinspector-network.android.js +3 -3
  93. package/debugger/webinspector-network.android.js.map +1 -1
  94. package/debugger/webinspector-network.ios.d.ts +9 -9
  95. package/debugger/webinspector-network.ios.js +1 -1
  96. package/debugger/webinspector-network.ios.js.map +1 -1
  97. package/fetch/index.js +458 -448
  98. package/file-system/file-system-access.android.js +39 -32
  99. package/file-system/file-system-access.android.js.map +1 -1
  100. package/file-system/index.d.ts +2 -2
  101. package/file-system/index.js +11 -4
  102. package/file-system/index.js.map +1 -1
  103. package/fps-meter/fps-native.android.d.ts +2 -1
  104. package/fps-meter/fps-native.android.js.map +1 -1
  105. package/fps-meter/fps-native.ios.d.ts +2 -1
  106. package/fps-meter/fps-native.ios.js.map +1 -1
  107. package/global-types.d.ts +1 -1
  108. package/globals/index.js +288 -254
  109. package/globals/index.js.map +1 -1
  110. package/http/http-request/http-request-common.js +2 -2
  111. package/http/http-request/http-request-common.js.map +1 -1
  112. package/http/http-request/index.android.d.ts +7 -3
  113. package/http/http-request/index.android.js +22 -6
  114. package/http/http-request/index.android.js.map +1 -1
  115. package/http/http-request/index.d.ts +1 -5
  116. package/http/http-request/index.ios.d.ts +7 -3
  117. package/http/http-request/index.ios.js +22 -6
  118. package/http/http-request/index.ios.js.map +1 -1
  119. package/http/index.d.ts +105 -6
  120. package/http/index.js +12 -10
  121. package/http/index.js.map +1 -1
  122. package/image-asset/index.android.js +3 -3
  123. package/image-asset/index.android.js.map +1 -1
  124. package/image-source/index.android.d.ts +1 -1
  125. package/image-source/index.android.js +23 -5
  126. package/image-source/index.android.js.map +1 -1
  127. package/image-source/index.ios.js +9 -2
  128. package/image-source/index.ios.js.map +1 -1
  129. package/index.d.ts +8 -12
  130. package/index.js +3 -6
  131. package/index.js.map +1 -1
  132. package/inspector_modules.d.ts +0 -3
  133. package/inspector_modules.js +3 -6
  134. package/inspector_modules.js.map +1 -1
  135. package/js-libs/easysax/easysax.js +3 -5
  136. package/media-query-list/index.js +17 -7
  137. package/media-query-list/index.js.map +1 -1
  138. package/module-name-resolver/index.d.ts +11 -2
  139. package/module-name-resolver/index.js +18 -6
  140. package/module-name-resolver/index.js.map +1 -1
  141. package/module-name-resolver/non-bundle-workflow-compat.js +23 -32
  142. package/module-name-resolver/non-bundle-workflow-compat.js.map +1 -1
  143. package/package.json +5 -8
  144. package/platform/device/index.android.js +2 -2
  145. package/platform/device/index.android.js.map +1 -1
  146. package/platform/screen/index.android.js +2 -2
  147. package/platform/screen/index.android.js.map +1 -1
  148. package/platform/screen/index.ios.js +2 -2
  149. package/platform/screen/index.ios.js.map +1 -1
  150. package/profiling/index.js +1 -2
  151. package/profiling/index.js.map +1 -1
  152. package/ui/action-bar/action-bar-common.js +2 -4
  153. package/ui/action-bar/action-bar-common.js.map +1 -1
  154. package/ui/action-bar/index.android.js +6 -7
  155. package/ui/action-bar/index.android.js.map +1 -1
  156. package/ui/action-bar/index.ios.js +11 -10
  157. package/ui/action-bar/index.ios.js.map +1 -1
  158. package/ui/activity-indicator/index.ios.js +4 -3
  159. package/ui/activity-indicator/index.ios.js.map +1 -1
  160. package/ui/animation/animation-common.d.ts +4 -4
  161. package/ui/animation/animation-common.js +3 -2
  162. package/ui/animation/animation-common.js.map +1 -1
  163. package/ui/animation/{animation-shared.d.ts → animation-interfaces.d.ts} +31 -39
  164. package/{core-types/animation-types.js → ui/animation/animation-interfaces.js} +1 -1
  165. package/ui/animation/animation-interfaces.js.map +1 -0
  166. package/ui/animation/index.android.d.ts +2 -1
  167. package/ui/animation/index.android.js +5 -5
  168. package/ui/animation/index.android.js.map +1 -1
  169. package/ui/animation/index.d.ts +138 -2
  170. package/ui/animation/index.ios.d.ts +2 -1
  171. package/ui/animation/index.ios.js +3 -3
  172. package/ui/animation/index.ios.js.map +1 -1
  173. package/ui/animation/keyframe-animation.d.ts +118 -67
  174. package/ui/animation/keyframe-animation.js +2 -2
  175. package/ui/animation/keyframe-animation.js.map +1 -1
  176. package/ui/builder/component-builder/index.js +2 -2
  177. package/ui/builder/component-builder/index.js.map +1 -1
  178. package/ui/builder/index.js +3 -415
  179. package/ui/builder/index.js.map +1 -1
  180. package/ui/builder/xml2ui.d.ts +134 -0
  181. package/ui/builder/xml2ui.js +397 -0
  182. package/ui/builder/xml2ui.js.map +1 -0
  183. package/ui/button/index.android.js +1 -2
  184. package/ui/button/index.android.js.map +1 -1
  185. package/ui/core/bindable/index.d.ts +38 -2
  186. package/ui/core/bindable/index.js +2 -1
  187. package/ui/core/bindable/index.js.map +1 -1
  188. package/ui/core/properties/index.d.ts +37 -4
  189. package/ui/core/properties/index.js +35 -6
  190. package/ui/core/properties/index.js.map +1 -1
  191. package/ui/core/view/index.android.d.ts +2 -2
  192. package/ui/core/view/index.android.js +10 -13
  193. package/ui/core/view/index.android.js.map +1 -1
  194. package/ui/core/view/index.d.ts +61 -1
  195. package/ui/core/view/index.ios.d.ts +3 -3
  196. package/ui/core/view/index.ios.js +13 -21
  197. package/ui/core/view/index.ios.js.map +1 -1
  198. package/ui/core/view/view-common.d.ts +16 -19
  199. package/ui/core/view/view-common.js +14 -12
  200. package/ui/core/view/view-common.js.map +1 -1
  201. package/ui/core/view/view-helper/index.ios.d.ts +1 -2
  202. package/ui/core/view/view-helper/index.ios.js +4 -3
  203. package/ui/core/view/view-helper/index.ios.js.map +1 -1
  204. package/ui/core/view/view-helper/view-helper-common.js +3 -1
  205. package/ui/core/view/view-helper/view-helper-common.js.map +1 -1
  206. package/ui/core/view-base/index.d.ts +25 -23
  207. package/ui/core/view-base/index.js +30 -9
  208. package/ui/core/view-base/index.js.map +1 -1
  209. package/ui/dialogs/dialogs-common.js +3 -3
  210. package/ui/dialogs/dialogs-common.js.map +1 -1
  211. package/ui/dialogs/index.android.js +7 -8
  212. package/ui/dialogs/index.android.js.map +1 -1
  213. package/ui/dialogs/index.ios.js +2 -2
  214. package/ui/dialogs/index.ios.js.map +1 -1
  215. package/ui/embedding/index.android.d.ts +1 -1
  216. package/ui/embedding/index.d.ts +1 -1
  217. package/ui/frame/callbacks/activity-callbacks.d.ts +19 -0
  218. package/ui/frame/callbacks/activity-callbacks.js +301 -0
  219. package/ui/frame/callbacks/activity-callbacks.js.map +1 -0
  220. package/ui/frame/{frame-helper-for-android.d.ts → callbacks/fragment-callbacks.d.ts} +1 -20
  221. package/ui/frame/{frame-helper-for-android.js → callbacks/fragment-callbacks.js} +38 -52
  222. package/ui/frame/callbacks/fragment-callbacks.js.map +1 -0
  223. package/ui/frame/fragment.android.js +2 -3
  224. package/ui/frame/fragment.android.js.map +1 -1
  225. package/ui/frame/fragment.transitions.android.js.map +1 -1
  226. package/ui/frame/frame-common.d.ts +2 -2
  227. package/ui/frame/frame-common.js.map +1 -1
  228. package/ui/frame/frame-interfaces.d.ts +4 -4
  229. package/ui/frame/frame-interfaces.js.map +1 -1
  230. package/ui/frame/frame-stack.js.map +1 -1
  231. package/ui/frame/index.android.d.ts +5 -20
  232. package/ui/frame/index.android.js +19 -296
  233. package/ui/frame/index.android.js.map +1 -1
  234. package/ui/frame/index.d.ts +19 -18
  235. package/ui/frame/index.ios.d.ts +1 -1
  236. package/ui/frame/index.ios.js +4 -5
  237. package/ui/frame/index.ios.js.map +1 -1
  238. package/ui/gestures/gestures-common.d.ts +273 -4
  239. package/ui/gestures/gestures-common.js +146 -3
  240. package/ui/gestures/gestures-common.js.map +1 -1
  241. package/ui/gestures/index.android.d.ts +1 -29
  242. package/ui/gestures/index.android.js +2 -4
  243. package/ui/gestures/index.android.js.map +1 -1
  244. package/ui/gestures/index.d.ts +0 -35
  245. package/ui/gestures/index.ios.d.ts +1 -35
  246. package/ui/gestures/index.ios.js +3 -3
  247. package/ui/gestures/index.ios.js.map +1 -1
  248. package/ui/gestures/touch-manager.d.ts +1 -1
  249. package/ui/html-view/index.ios.js +3 -3
  250. package/ui/html-view/index.ios.js.map +1 -1
  251. package/ui/image/image-common.js +1 -1
  252. package/ui/image/image-common.js.map +1 -1
  253. package/ui/image/index.android.js +1 -1
  254. package/ui/image/index.android.js.map +1 -1
  255. package/ui/image-cache/index.ios.js +11 -5
  256. package/ui/image-cache/index.ios.js.map +1 -1
  257. package/ui/index.d.ts +5 -10
  258. package/ui/index.js +3 -11
  259. package/ui/index.js.map +1 -1
  260. package/ui/label/index.ios.js.map +1 -1
  261. package/ui/layouts/absolute-layout/absolute-layout-common.js +1 -1
  262. package/ui/layouts/absolute-layout/absolute-layout-common.js.map +1 -1
  263. package/ui/layouts/absolute-layout/index.android.js +1 -1
  264. package/ui/layouts/absolute-layout/index.android.js.map +1 -1
  265. package/ui/layouts/absolute-layout/index.d.ts +1 -1
  266. package/ui/layouts/absolute-layout/index.ios.js.map +1 -1
  267. package/ui/layouts/flexbox-layout/flexbox-layout-common.js +1 -2
  268. package/ui/layouts/flexbox-layout/flexbox-layout-common.js.map +1 -1
  269. package/ui/layouts/flexbox-layout/index.android.js +1 -1
  270. package/ui/layouts/flexbox-layout/index.android.js.map +1 -1
  271. package/ui/layouts/flexbox-layout/index.ios.js.map +1 -1
  272. package/ui/layouts/layout-base.android.js +1 -2
  273. package/ui/layouts/layout-base.android.js.map +1 -1
  274. package/ui/layouts/stack-layout/index.ios.js.map +1 -1
  275. package/ui/layouts/wrap-layout/index.android.js +1 -1
  276. package/ui/layouts/wrap-layout/index.android.js.map +1 -1
  277. package/ui/layouts/wrap-layout/index.d.ts +1 -1
  278. package/ui/layouts/wrap-layout/wrap-layout-common.js +1 -1
  279. package/ui/layouts/wrap-layout/wrap-layout-common.js.map +1 -1
  280. package/ui/list-view/index.android.js +1 -1
  281. package/ui/list-view/index.android.js.map +1 -1
  282. package/ui/list-view/index.d.ts +1 -1
  283. package/ui/list-view/index.ios.js +1 -1
  284. package/ui/list-view/index.ios.js.map +1 -1
  285. package/ui/list-view/list-view-common.js +1 -1
  286. package/ui/list-view/list-view-common.js.map +1 -1
  287. package/ui/page/index.android.js +1 -2
  288. package/ui/page/index.android.js.map +1 -1
  289. package/ui/page/index.d.ts +1 -1
  290. package/ui/page/index.ios.js +5 -4
  291. package/ui/page/index.ios.js.map +1 -1
  292. package/ui/page/page-common.d.ts +2 -3
  293. package/ui/page/page-common.js +4 -5
  294. package/ui/page/page-common.js.map +1 -1
  295. package/ui/scroll-view/index.ios.js +3 -3
  296. package/ui/scroll-view/index.ios.js.map +1 -1
  297. package/ui/styling/background-common.js +1 -0
  298. package/ui/styling/background-common.js.map +1 -1
  299. package/ui/styling/background.android.d.ts +6 -0
  300. package/ui/styling/background.android.js +53 -1
  301. package/ui/styling/background.android.js.map +1 -1
  302. package/ui/styling/background.ios.js +1 -2
  303. package/ui/styling/background.ios.js.map +1 -1
  304. package/ui/styling/converters.d.ts +2 -2
  305. package/ui/styling/css-shadow.js.map +1 -1
  306. package/ui/styling/css-stroke.js.map +1 -1
  307. package/ui/styling/css-transform.d.ts +1 -1
  308. package/ui/styling/css-utils.js +1 -1
  309. package/ui/styling/css-utils.js.map +1 -1
  310. package/ui/styling/font.android.js +2 -2
  311. package/ui/styling/font.android.js.map +1 -1
  312. package/ui/styling/font.ios.js +10 -10
  313. package/ui/styling/font.ios.js.map +1 -1
  314. package/ui/styling/style/index.d.ts +1 -1
  315. package/ui/styling/style-properties.d.ts +113 -58
  316. package/ui/styling/style-properties.js +93 -7
  317. package/ui/styling/style-properties.js.map +1 -1
  318. package/ui/styling/style-scope.d.ts +48 -85
  319. package/ui/styling/style-scope.js +36 -30
  320. package/ui/styling/style-scope.js.map +1 -1
  321. package/ui/switch/index.ios.js +5 -5
  322. package/ui/switch/index.ios.js.map +1 -1
  323. package/ui/tab-view/index.android.js +6 -6
  324. package/ui/tab-view/index.android.js.map +1 -1
  325. package/ui/text-base/index.android.d.ts +1 -1
  326. package/ui/text-base/index.android.js +4 -4
  327. package/ui/text-base/index.android.js.map +1 -1
  328. package/ui/text-base/index.d.ts +1 -1
  329. package/ui/text-base/index.ios.js +4 -5
  330. package/ui/text-base/index.ios.js.map +1 -1
  331. package/ui/text-view/index.ios.js.map +1 -1
  332. package/ui/transition/fade-transition.ios.js +1 -1
  333. package/ui/transition/fade-transition.ios.js.map +1 -1
  334. package/ui/transition/index.ios.js +1 -1
  335. package/ui/transition/index.ios.js.map +1 -1
  336. package/ui/transition/modal-transition.ios.js +1 -1
  337. package/ui/transition/modal-transition.ios.js.map +1 -1
  338. package/ui/transition/page-transition.android.d.ts +1 -1
  339. package/ui/transition/page-transition.android.js +4 -4
  340. package/ui/transition/page-transition.android.js.map +1 -1
  341. package/ui/transition/page-transition.ios.js +1 -1
  342. package/ui/transition/page-transition.ios.js.map +1 -1
  343. package/ui/transition/shared-transition-helper.ios.js +1 -1
  344. package/ui/transition/shared-transition-helper.ios.js.map +1 -1
  345. package/ui/transition/shared-transition.js +1 -2
  346. package/ui/transition/shared-transition.js.map +1 -1
  347. package/ui/transition/slide-transition.ios.js +2 -2
  348. package/ui/transition/slide-transition.ios.js.map +1 -1
  349. package/utils/{native-helper-for-android.d.ts → android/index.d.ts} +2 -4
  350. package/utils/android/index.js +160 -0
  351. package/utils/android/index.js.map +1 -0
  352. package/utils/common.d.ts +38 -1
  353. package/utils/common.js +111 -1
  354. package/utils/common.js.map +1 -1
  355. package/utils/debug.js +59 -1
  356. package/utils/debug.js.map +1 -1
  357. package/utils/index.android.d.ts +1 -3
  358. package/utils/index.android.js +11 -37
  359. package/utils/index.android.js.map +1 -1
  360. package/utils/index.d.ts +14 -2
  361. package/utils/index.ios.d.ts +1 -4
  362. package/utils/index.ios.js +5 -32
  363. package/utils/index.ios.js.map +1 -1
  364. package/utils/ios/index.d.ts +39 -0
  365. package/utils/ios/index.js +229 -0
  366. package/utils/ios/index.js.map +1 -0
  367. package/utils/layout-helper/index.android.js +4 -4
  368. package/utils/layout-helper/index.android.js.map +1 -1
  369. package/utils/layout-helper/index.d.ts +4 -6
  370. package/utils/layout-helper/index.ios.js +5 -5
  371. package/utils/layout-helper/index.ios.js.map +1 -1
  372. package/utils/layout-helper/layout-helper-common.d.ts +9 -0
  373. package/utils/layout-helper/layout-helper-common.js +9 -1
  374. package/utils/layout-helper/layout-helper-common.js.map +1 -1
  375. package/utils/native-helper.android.d.ts +5 -29
  376. package/utils/native-helper.android.js +131 -18
  377. package/utils/native-helper.android.js.map +1 -1
  378. package/utils/native-helper.d.ts +258 -206
  379. package/utils/native-helper.ios.d.ts +3 -72
  380. package/utils/native-helper.ios.js +3 -250
  381. package/utils/native-helper.ios.js.map +1 -1
  382. package/xhr/index.js +13 -12
  383. package/xhr/index.js.map +1 -1
  384. package/xml/index.d.ts +98 -94
  385. package/xml/index.js +2 -58
  386. package/xml/index.js.map +1 -1
  387. package/accessibility/index.js +0 -2
  388. package/accessibility/index.js.map +0 -1
  389. package/application/helpers-common.d.ts +0 -50
  390. package/application/helpers-common.js +0 -153
  391. package/application/helpers-common.js.map +0 -1
  392. package/application/helpers.android.d.ts +0 -17
  393. package/application/helpers.android.js +0 -173
  394. package/application/helpers.android.js.map +0 -1
  395. package/application/helpers.d.ts +0 -25
  396. package/application/helpers.ios.d.ts +0 -27
  397. package/application/helpers.ios.js +0 -62
  398. package/application/helpers.ios.js.map +0 -1
  399. package/cli-hooks/postinstall.mjs +0 -7
  400. package/cli-hooks/preuninstall.mjs +0 -7
  401. package/color/color-types.d.ts +0 -49
  402. package/color/color-types.js +0 -3
  403. package/color/color-types.js.map +0 -1
  404. package/core-types/animation-types.d.ts +0 -11
  405. package/core-types/animation-types.js.map +0 -1
  406. package/core-types/validators.d.ts +0 -2
  407. package/core-types/validators.js +0 -18
  408. package/core-types/validators.js.map +0 -1
  409. package/css/lib/parse/index.d.ts +0 -1
  410. package/css/lib/parse/index.js.map +0 -1
  411. package/css/reworkcss.js.map +0 -1
  412. package/css-value/reworkcss-value.js.map +0 -1
  413. package/debugger/dom-types.d.ts +0 -24
  414. package/debugger/dom-types.js.map +0 -1
  415. package/fetch/index.d.ts +0 -72
  416. package/fetch/index.js.map +0 -1
  417. package/globals/global-utils.d.ts +0 -27
  418. package/globals/global-utils.js +0 -67
  419. package/globals/global-utils.js.map +0 -1
  420. package/http/http-interfaces.d.ts +0 -84
  421. package/http/http-interfaces.js +0 -6
  422. package/http/http-interfaces.js.map +0 -1
  423. package/http/http-shared.d.ts +0 -5
  424. package/http/http-shared.js +0 -14
  425. package/http/http-shared.js.map +0 -1
  426. package/module-name-resolver/helpers.d.ts +0 -14
  427. package/module-name-resolver/helpers.js +0 -27
  428. package/module-name-resolver/helpers.js.map +0 -1
  429. package/ui/animation/animation-shared.js +0 -4
  430. package/ui/animation/animation-shared.js.map +0 -1
  431. package/ui/animation/animation-types.d.ts +0 -1
  432. package/ui/animation/animation-types.js +0 -3
  433. package/ui/animation/animation-types.js.map +0 -1
  434. package/ui/core/bindable/bindable-types.d.ts +0 -37
  435. package/ui/core/bindable/bindable-types.js +0 -3
  436. package/ui/core/bindable/bindable-types.js.map +0 -1
  437. package/ui/core/properties/property-shared.d.ts +0 -35
  438. package/ui/core/properties/property-shared.js +0 -16
  439. package/ui/core/properties/property-shared.js.map +0 -1
  440. package/ui/core/view/view-helper/view-helper-shared.d.ts +0 -5
  441. package/ui/core/view/view-helper/view-helper-shared.js +0 -6
  442. package/ui/core/view/view-helper/view-helper-shared.js.map +0 -1
  443. package/ui/core/view/view-interfaces.d.ts +0 -54
  444. package/ui/core/view/view-interfaces.js +0 -2
  445. package/ui/core/view/view-interfaces.js.map +0 -1
  446. package/ui/core/view-base/utils.d.ts +0 -1
  447. package/ui/core/view-base/utils.js +0 -9
  448. package/ui/core/view-base/utils.js.map +0 -1
  449. package/ui/frame/frame-helper-for-android.js.map +0 -1
  450. package/ui/gestures/gestures-types.d.ts +0 -108
  451. package/ui/gestures/gestures-types.js +0 -40
  452. package/ui/gestures/gestures-types.js.map +0 -1
  453. package/ui/page/events.d.ts +0 -6
  454. package/ui/page/events.js +0 -7
  455. package/ui/page/events.js.map +0 -1
  456. package/ui/styling/length-shared.d.ts +0 -52
  457. package/ui/styling/length-shared.js +0 -173
  458. package/ui/styling/length-shared.js.map +0 -1
  459. package/ui/styling/styling-profile.d.ts +0 -1
  460. package/ui/styling/styling-profile.js +0 -4
  461. package/ui/styling/styling-profile.js.map +0 -1
  462. package/ui/styling/styling-shared.d.ts +0 -3
  463. package/ui/styling/styling-shared.js +0 -6
  464. package/ui/styling/styling-shared.js.map +0 -1
  465. package/utils/animation-helpers.d.ts +0 -27
  466. package/utils/animation-helpers.js +0 -48
  467. package/utils/animation-helpers.js.map +0 -1
  468. package/utils/debug-source.d.ts +0 -19
  469. package/utils/debug-source.js +0 -78
  470. package/utils/debug-source.js.map +0 -1
  471. package/utils/layout-helper/layout-helper-shared.d.ts +0 -9
  472. package/utils/layout-helper/layout-helper-shared.js +0 -13
  473. package/utils/layout-helper/layout-helper-shared.js.map +0 -1
  474. package/utils/native-helper-for-android.js +0 -273
  475. package/utils/native-helper-for-android.js.map +0 -1
  476. package/utils/shared.d.ts +0 -17
  477. package/utils/shared.js +0 -40
  478. package/utils/shared.js.map +0 -1
  479. package/utils/utils-shared.d.ts +0 -1
  480. package/utils/utils-shared.js +0 -8
  481. package/utils/utils-shared.js.map +0 -1
@@ -1,13 +1,29 @@
1
1
  import { profile } from '../profiling';
2
+ import { isEmbedded } from '../ui/embedding';
2
3
  import { SDK_VERSION } from '../utils/constants';
3
- import { android as androidUtils } from '../utils';
4
4
  import { ApplicationCommon } from './application-common';
5
- import { Observable } from '../data/observable';
6
- import { Trace } from '../trace';
7
- import { CommonA11YServiceEnabledObservable, SharedA11YObservable, notifyAccessibilityFocusState, a11yServiceClasses, a11yServiceDisabledClass, a11yServiceEnabledClass, fontScaleCategoryClasses, fontScaleExtraLargeCategoryClass, fontScaleExtraSmallCategoryClass, fontScaleMediumCategoryClass, getCurrentA11YServiceClass, getCurrentFontScaleCategory, getCurrentFontScaleClass, getFontScaleCssClasses, setCurrentA11YServiceClass, setCurrentFontScaleCategory, setCurrentFontScaleClass, setFontScaleCssClasses, setFontScale, getFontScale, setInitFontScale, getFontScaleCategory, setInitAccessibilityCssHelper, FontScaleCategory, getClosestValidFontScale, VALID_FONT_SCALES, AccessibilityRole, AccessibilityState, AndroidAccessibilityEvent, isA11yEnabled, setA11yEnabled, } from '../accessibility/accessibility-common';
8
- import { androidGetForegroundActivity, androidGetStartActivity, androidPendingReceiverRegistrations, androidRegisterBroadcastReceiver, androidRegisteredReceivers, androidSetForegroundActivity, androidSetStartActivity, androidUnregisterBroadcastReceiver, applyContentDescription } from './helpers';
9
- import { getImageFetcher, getNativeApp, getRootView, initImageCache, setA11yUpdatePropertiesCallback, setApplicationPropertiesCallback, setAppMainEntry, setNativeApp, setRootView, setToggleApplicationEventListenersCallback } from './helpers-common';
10
- import { getNativeScriptGlobals } from '../globals/global-utils';
5
+ let BroadcastReceiver_;
6
+ function initBroadcastReceiver() {
7
+ if (BroadcastReceiver_) {
8
+ return BroadcastReceiver_;
9
+ }
10
+ var BroadcastReceiverImpl = /** @class */ (function (_super) {
11
+ __extends(BroadcastReceiverImpl, _super);
12
+ function BroadcastReceiverImpl(onReceiveCallback) {
13
+ var _this = _super.call(this) || this;
14
+ _this._onReceiveCallback = onReceiveCallback;
15
+ return global.__native(_this);
16
+ }
17
+ BroadcastReceiverImpl.prototype.onReceive = function (context, intent) {
18
+ if (this._onReceiveCallback) {
19
+ this._onReceiveCallback(context, intent);
20
+ }
21
+ };
22
+ return BroadcastReceiverImpl;
23
+ }(android.content.BroadcastReceiver));
24
+ BroadcastReceiver_ = BroadcastReceiverImpl;
25
+ return BroadcastReceiver_;
26
+ }
11
27
  let NativeScriptLifecycleCallbacks_;
12
28
  function initNativeScriptLifecycleCallbacks() {
13
29
  if (NativeScriptLifecycleCallbacks_) {
@@ -294,6 +310,8 @@ export class AndroidApplication extends ApplicationCommon {
294
310
  this.activityBackPressedEvent = AndroidApplication.activityBackPressedEvent;
295
311
  this.activityNewIntentEvent = AndroidApplication.activityNewIntentEvent;
296
312
  this.activityRequestPermissionsEvent = AndroidApplication.activityRequestPermissionsEvent;
313
+ this._registeredReceivers = {};
314
+ this._pendingReceiverRegistrations = new Array();
297
315
  }
298
316
  init(nativeApp) {
299
317
  if (this.nativeApp === nativeApp) {
@@ -303,7 +321,6 @@ export class AndroidApplication extends ApplicationCommon {
303
321
  throw new Error('Application.android already initialized.');
304
322
  }
305
323
  this._nativeApp = nativeApp;
306
- setNativeApp(nativeApp);
307
324
  this._context = nativeApp.getApplicationContext();
308
325
  this._packageName = nativeApp.getPackageName();
309
326
  // we store those callbacks and add a function for clearing them later so that the objects will be eligable for GC
@@ -314,8 +331,8 @@ export class AndroidApplication extends ApplicationCommon {
314
331
  this._registerPendingReceivers();
315
332
  }
316
333
  _registerPendingReceivers() {
317
- androidPendingReceiverRegistrations.forEach((func) => func(this.context));
318
- androidPendingReceiverRegistrations.length = 0;
334
+ this._pendingReceiverRegistrations.forEach((func) => func(this.context));
335
+ this._pendingReceiverRegistrations.length = 0;
319
336
  }
320
337
  onConfigurationChanged(configuration) {
321
338
  this.setOrientation(this.getOrientationValue(configuration));
@@ -326,7 +343,25 @@ export class AndroidApplication extends ApplicationCommon {
326
343
  if (nativeApp) {
327
344
  return nativeApp;
328
345
  }
329
- nativeApp = getNativeApp();
346
+ // Try getting it from module - check whether application.android.init has been explicitly called
347
+ // check whether the com.tns.NativeScriptApplication type exists
348
+ if (com.tns.NativeScriptApplication) {
349
+ nativeApp = com.tns.NativeScriptApplication.getInstance();
350
+ }
351
+ if (!nativeApp && isEmbedded()) {
352
+ nativeApp = com.tns.embedding.ApplicationHolder.getInstance();
353
+ }
354
+ // the getInstance might return null if com.tns.NativeScriptApplication exists but is not the starting app type
355
+ if (!nativeApp) {
356
+ // TODO: Should we handle the case when a custom application type is provided and the user has not explicitly initialized the application module?
357
+ const clazz = java.lang.Class.forName('android.app.ActivityThread');
358
+ if (clazz) {
359
+ const method = clazz.getMethod('currentApplication', null);
360
+ if (method) {
361
+ nativeApp = method.invoke(null, null);
362
+ }
363
+ }
364
+ }
330
365
  // we cannot work without having the app instance
331
366
  if (!nativeApp) {
332
367
  throw new Error("Failed to retrieve native Android Application object. If you have a custom android.app.Application type implemented make sure that you've called the 'Application.android.init' method.");
@@ -341,23 +376,23 @@ export class AndroidApplication extends ApplicationCommon {
341
376
  throw new Error('Application is already started.');
342
377
  }
343
378
  this.started = true;
344
- setAppMainEntry(typeof entry === 'string' ? { moduleName: entry } : entry);
379
+ this.mainEntry = typeof entry === 'string' ? { moduleName: entry } : entry;
345
380
  if (!this.nativeApp) {
346
381
  const nativeApp = this.getNativeApplication();
347
382
  this.init(nativeApp);
348
383
  }
349
384
  }
350
385
  get startActivity() {
351
- return androidGetStartActivity();
386
+ return this._startActivity;
352
387
  }
353
388
  get foregroundActivity() {
354
- return androidGetForegroundActivity();
389
+ return this._foregroundActivity;
355
390
  }
356
391
  setStartActivity(value) {
357
- androidSetStartActivity(value);
392
+ this._startActivity = value;
358
393
  }
359
394
  setForegroundActivity(value) {
360
- androidSetForegroundActivity(value);
395
+ this._foregroundActivity = value;
361
396
  }
362
397
  get paused() {
363
398
  return this.suspended;
@@ -376,13 +411,33 @@ export class AndroidApplication extends ApplicationCommon {
376
411
  // RECEIVER_NOT_EXPORTED (4)
377
412
  // RECEIVER_VISIBLE_TO_INSTANT_APPS (1)
378
413
  registerBroadcastReceiver(intentFilter, onReceiveCallback, flags = 2) {
379
- androidRegisterBroadcastReceiver(intentFilter, onReceiveCallback, flags);
414
+ const registerFunc = (context) => {
415
+ const receiver = new (initBroadcastReceiver())(onReceiveCallback);
416
+ if (SDK_VERSION >= 26) {
417
+ context.registerReceiver(receiver, new android.content.IntentFilter(intentFilter), flags);
418
+ }
419
+ else {
420
+ context.registerReceiver(receiver, new android.content.IntentFilter(intentFilter));
421
+ }
422
+ this._registeredReceivers[intentFilter] = receiver;
423
+ };
424
+ if (this.context) {
425
+ registerFunc(this.context);
426
+ }
427
+ else {
428
+ this._pendingReceiverRegistrations.push(registerFunc);
429
+ }
380
430
  }
381
431
  unregisterBroadcastReceiver(intentFilter) {
382
- androidUnregisterBroadcastReceiver(intentFilter);
432
+ const receiver = this._registeredReceivers[intentFilter];
433
+ if (receiver) {
434
+ this.context.unregisterReceiver(receiver);
435
+ this._registeredReceivers[intentFilter] = undefined;
436
+ delete this._registeredReceivers[intentFilter];
437
+ }
383
438
  }
384
439
  getRegisteredBroadcastReceiver(intentFilter) {
385
- return androidRegisteredReceivers[intentFilter];
440
+ return this._registeredReceivers[intentFilter];
386
441
  }
387
442
  getRootView() {
388
443
  const activity = this.foregroundActivity || this.startActivity;
@@ -390,8 +445,7 @@ export class AndroidApplication extends ApplicationCommon {
390
445
  return undefined;
391
446
  }
392
447
  const callbacks = activity['_callbacks'];
393
- setRootView(callbacks ? callbacks.getRootView() : undefined);
394
- return getRootView();
448
+ return callbacks ? callbacks.getRootView() : undefined;
395
449
  }
396
450
  resetRootView(entry) {
397
451
  super.resetRootView(entry);
@@ -457,737 +511,4 @@ AndroidApplication.activityRequestPermissionsEvent = 'activityRequestPermissions
457
511
  export * from './application-common';
458
512
  export const Application = new AndroidApplication();
459
513
  export const iOSApplication = undefined;
460
- function fontScaleChanged(origFontScale) {
461
- const oldValue = getFontScale();
462
- setFontScale(getClosestValidFontScale(origFontScale));
463
- const currentFontScale = getFontScale();
464
- if (oldValue !== currentFontScale) {
465
- Application.notify({
466
- eventName: Application.fontScaleChangedEvent,
467
- object: Application,
468
- newValue: currentFontScale,
469
- });
470
- }
471
- }
472
- export function getCurrentFontScale() {
473
- setupConfigListener();
474
- return getFontScale();
475
- }
476
- function useAndroidFontScale() {
477
- fontScaleChanged(Number(Application.android.context.getResources().getConfiguration().fontScale));
478
- }
479
- let configChangedCallback;
480
- function setupConfigListener() {
481
- if (configChangedCallback) {
482
- return;
483
- }
484
- Application.off(Application.launchEvent, setupConfigListener);
485
- const context = Application.android?.context;
486
- if (!context) {
487
- Application.on(Application.launchEvent, setupConfigListener);
488
- return;
489
- }
490
- useAndroidFontScale();
491
- configChangedCallback = new android.content.ComponentCallbacks2({
492
- onLowMemory() {
493
- // Dummy
494
- },
495
- onTrimMemory() {
496
- // Dummy
497
- },
498
- onConfigurationChanged(newConfig) {
499
- fontScaleChanged(Number(newConfig.fontScale));
500
- },
501
- });
502
- context.registerComponentCallbacks(configChangedCallback);
503
- Application.on(Application.resumeEvent, useAndroidFontScale);
504
- }
505
- setInitFontScale(setupConfigListener);
506
- function applyRootCssClass(cssClasses, newCssClass) {
507
- const rootView = Application.getRootView();
508
- if (!rootView) {
509
- return;
510
- }
511
- Application.applyCssClass(rootView, cssClasses, newCssClass);
512
- const rootModalViews = rootView._getRootModalViews();
513
- rootModalViews.forEach((rootModalView) => Application.applyCssClass(rootModalView, cssClasses, newCssClass));
514
- }
515
- function applyFontScaleToRootViews() {
516
- const rootView = Application.getRootView();
517
- if (!rootView) {
518
- return;
519
- }
520
- const fontScale = getCurrentFontScale();
521
- rootView.style.fontScaleInternal = fontScale;
522
- const rootModalViews = rootView._getRootModalViews();
523
- rootModalViews.forEach((rootModalView) => (rootModalView.style.fontScaleInternal = fontScale));
524
- }
525
- export function getAndroidAccessibilityManager() {
526
- const context = getNativeApp().getApplicationContext();
527
- if (!context) {
528
- return null;
529
- }
530
- return context.getSystemService(android.content.Context.ACCESSIBILITY_SERVICE);
531
- }
532
- const accessibilityStateEnabledPropName = 'accessibilityStateEnabled';
533
- const touchExplorationStateEnabledPropName = 'touchExplorationStateEnabled';
534
- class AndroidSharedA11YObservable extends SharedA11YObservable {
535
- // @ts-ignore todo: fix
536
- get accessibilityServiceEnabled() {
537
- return !!this[accessibilityStateEnabledPropName] && !!this[touchExplorationStateEnabledPropName];
538
- }
539
- set accessibilityServiceEnabled(v) {
540
- return;
541
- }
542
- }
543
- let accessibilityStateChangeListener;
544
- let touchExplorationStateChangeListener;
545
- let sharedA11YObservable;
546
- function updateAccessibilityState() {
547
- const accessibilityManager = getAndroidAccessibilityManager();
548
- if (!accessibilityManager) {
549
- sharedA11YObservable.set(accessibilityStateEnabledPropName, false);
550
- sharedA11YObservable.set(touchExplorationStateEnabledPropName, false);
551
- return;
552
- }
553
- sharedA11YObservable.set(accessibilityStateEnabledPropName, !!accessibilityManager.isEnabled());
554
- sharedA11YObservable.set(touchExplorationStateEnabledPropName, !!accessibilityManager.isTouchExplorationEnabled());
555
- }
556
- function ensureStateListener() {
557
- if (sharedA11YObservable) {
558
- return sharedA11YObservable;
559
- }
560
- const accessibilityManager = getAndroidAccessibilityManager();
561
- sharedA11YObservable = new AndroidSharedA11YObservable();
562
- if (!accessibilityManager) {
563
- sharedA11YObservable.set(accessibilityStateEnabledPropName, false);
564
- sharedA11YObservable.set(touchExplorationStateEnabledPropName, false);
565
- return sharedA11YObservable;
566
- }
567
- accessibilityStateChangeListener = new android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener({
568
- onAccessibilityStateChanged(enabled) {
569
- updateAccessibilityState();
570
- if (Trace.isEnabled()) {
571
- Trace.write(`AccessibilityStateChangeListener state changed to: ${!!enabled}`, Trace.categories.Accessibility);
572
- }
573
- },
574
- });
575
- accessibilityManager.addAccessibilityStateChangeListener(accessibilityStateChangeListener);
576
- if (SDK_VERSION >= 19) {
577
- touchExplorationStateChangeListener = new android.view.accessibility.AccessibilityManager.TouchExplorationStateChangeListener({
578
- onTouchExplorationStateChanged(enabled) {
579
- updateAccessibilityState();
580
- if (Trace.isEnabled()) {
581
- Trace.write(`TouchExplorationStateChangeListener state changed to: ${!!enabled}`, Trace.categories.Accessibility);
582
- }
583
- },
584
- });
585
- accessibilityManager.addTouchExplorationStateChangeListener(touchExplorationStateChangeListener);
586
- }
587
- updateAccessibilityState();
588
- Application.on(Application.resumeEvent, updateAccessibilityState);
589
- Application.on(Application.exitEvent, (args) => {
590
- const activity = args.android;
591
- if (activity && !activity.isFinishing()) {
592
- return;
593
- }
594
- const accessibilityManager = getAndroidAccessibilityManager();
595
- if (accessibilityManager) {
596
- if (accessibilityStateChangeListener) {
597
- accessibilityManager.removeAccessibilityStateChangeListener(accessibilityStateChangeListener);
598
- }
599
- if (touchExplorationStateChangeListener) {
600
- accessibilityManager.removeTouchExplorationStateChangeListener(touchExplorationStateChangeListener);
601
- }
602
- }
603
- accessibilityStateChangeListener = null;
604
- touchExplorationStateChangeListener = null;
605
- if (sharedA11YObservable) {
606
- sharedA11YObservable.removeEventListener(Observable.propertyChangeEvent);
607
- sharedA11YObservable = null;
608
- }
609
- Application.off(Application.resumeEvent, updateAccessibilityState);
610
- });
611
- return sharedA11YObservable;
612
- }
613
- export class AccessibilityServiceEnabledObservable extends CommonA11YServiceEnabledObservable {
614
- constructor() {
615
- super(ensureStateListener());
616
- }
617
- }
618
- let accessibilityServiceObservable;
619
- export function ensureClasses() {
620
- if (accessibilityServiceObservable) {
621
- return;
622
- }
623
- setFontScaleCssClasses(new Map(VALID_FONT_SCALES.map((fs) => [fs, `a11y-fontscale-${Number(fs * 100).toFixed(0)}`])));
624
- accessibilityServiceObservable = new AccessibilityServiceEnabledObservable();
625
- }
626
- export function updateCurrentHelperClasses(applyRootCssClass) {
627
- const fontScale = getFontScale();
628
- const fontScaleCategory = getFontScaleCategory();
629
- const fontScaleCssClasses = getFontScaleCssClasses();
630
- const oldFontScaleClass = getCurrentFontScaleClass();
631
- if (fontScaleCssClasses.has(fontScale)) {
632
- setCurrentFontScaleClass(fontScaleCssClasses.get(fontScale));
633
- }
634
- else {
635
- setCurrentFontScaleClass(fontScaleCssClasses.get(1));
636
- }
637
- if (oldFontScaleClass !== getCurrentFontScaleClass()) {
638
- applyRootCssClass([...fontScaleCssClasses.values()], getCurrentFontScaleClass());
639
- }
640
- const oldActiveFontScaleCategory = getCurrentFontScaleCategory();
641
- switch (fontScaleCategory) {
642
- case FontScaleCategory.ExtraSmall: {
643
- setCurrentFontScaleCategory(fontScaleExtraSmallCategoryClass);
644
- break;
645
- }
646
- case FontScaleCategory.Medium: {
647
- setCurrentFontScaleCategory(fontScaleMediumCategoryClass);
648
- break;
649
- }
650
- case FontScaleCategory.ExtraLarge: {
651
- setCurrentFontScaleCategory(fontScaleExtraLargeCategoryClass);
652
- break;
653
- }
654
- default: {
655
- setCurrentFontScaleCategory(fontScaleMediumCategoryClass);
656
- break;
657
- }
658
- }
659
- if (oldActiveFontScaleCategory !== getCurrentFontScaleCategory()) {
660
- applyRootCssClass(fontScaleCategoryClasses, getCurrentFontScaleCategory());
661
- }
662
- const oldA11YStatusClass = getCurrentA11YServiceClass();
663
- if (accessibilityServiceObservable.accessibilityServiceEnabled) {
664
- setCurrentA11YServiceClass(a11yServiceEnabledClass);
665
- }
666
- else {
667
- setCurrentA11YServiceClass(a11yServiceDisabledClass);
668
- }
669
- if (oldA11YStatusClass !== getCurrentA11YServiceClass()) {
670
- applyRootCssClass(a11yServiceClasses, getCurrentA11YServiceClass());
671
- }
672
- }
673
- export function initAccessibilityCssHelper() {
674
- ensureClasses();
675
- Application.on(Application.fontScaleChangedEvent, () => {
676
- updateCurrentHelperClasses(applyRootCssClass);
677
- applyFontScaleToRootViews();
678
- });
679
- accessibilityServiceObservable.on(AccessibilityServiceEnabledObservable.propertyChangeEvent, () => updateCurrentHelperClasses(applyRootCssClass));
680
- }
681
- setInitAccessibilityCssHelper(initAccessibilityCssHelper);
682
- let clickableRolesMap = new Set();
683
- let lastFocusedView;
684
- function accessibilityEventHelper(view, eventType) {
685
- const eventName = accessibilityEventTypeMap.get(eventType);
686
- if (!isAccessibilityServiceEnabled()) {
687
- if (Trace.isEnabled()) {
688
- Trace.write(`accessibilityEventHelper: Service not active`, Trace.categories.Accessibility);
689
- }
690
- return;
691
- }
692
- if (!eventName) {
693
- Trace.write(`accessibilityEventHelper: unknown eventType: ${eventType}`, Trace.categories.Accessibility, Trace.messageType.error);
694
- return;
695
- }
696
- if (!view) {
697
- if (Trace.isEnabled()) {
698
- Trace.write(`accessibilityEventHelper: no owner: ${eventName}`, Trace.categories.Accessibility);
699
- }
700
- return;
701
- }
702
- const androidView = view.nativeViewProtected;
703
- if (!androidView) {
704
- if (Trace.isEnabled()) {
705
- Trace.write(`accessibilityEventHelper: no nativeView`, Trace.categories.Accessibility);
706
- }
707
- return;
708
- }
709
- switch (eventType) {
710
- case android.view.accessibility.AccessibilityEvent.TYPE_VIEW_CLICKED: {
711
- /**
712
- * Android API >= 26 handles accessibility tap-events by converting them to TYPE_VIEW_CLICKED
713
- * These aren't triggered for custom tap events in NativeScript.
714
- */
715
- if (SDK_VERSION >= 26) {
716
- // Find all tap gestures and trigger them.
717
- for (const tapGesture of view.getGestureObservers(1) ?? []) {
718
- tapGesture.callback({
719
- android: view.android,
720
- eventName: 'tap',
721
- ios: null,
722
- object: view,
723
- type: 1,
724
- view: view,
725
- });
726
- }
727
- }
728
- return;
729
- }
730
- case android.view.accessibility.AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED: {
731
- const lastView = lastFocusedView?.get();
732
- if (lastView && view !== lastView) {
733
- const lastAndroidView = lastView.nativeViewProtected;
734
- if (lastAndroidView) {
735
- lastAndroidView.clearFocus();
736
- lastFocusedView = null;
737
- notifyAccessibilityFocusState(lastView, false, true);
738
- }
739
- }
740
- lastFocusedView = new WeakRef(view);
741
- notifyAccessibilityFocusState(view, true, false);
742
- return;
743
- }
744
- case android.view.accessibility.AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED: {
745
- const lastView = lastFocusedView?.get();
746
- if (lastView && view === lastView) {
747
- lastFocusedView = null;
748
- androidView.clearFocus();
749
- }
750
- notifyAccessibilityFocusState(view, false, true);
751
- return;
752
- }
753
- }
754
- }
755
- let TNSAccessibilityDelegate;
756
- const androidViewToTNSView = new WeakMap();
757
- let accessibilityEventMap;
758
- let accessibilityEventTypeMap;
759
- function ensureNativeClasses() {
760
- if (TNSAccessibilityDelegate) {
761
- return;
762
- }
763
- // WORKAROUND: Typing refers to android.view.View.androidviewViewAccessibilityDelegate but it is called android.view.View.AccessibilityDelegate at runtime
764
- const AccessibilityDelegate = android.view.View['AccessibilityDelegate'];
765
- const RoleTypeMap = new Map([
766
- [AccessibilityRole.Button, android.widget.Button.class.getName()],
767
- [AccessibilityRole.Search, android.widget.EditText.class.getName()],
768
- [AccessibilityRole.Image, android.widget.ImageView.class.getName()],
769
- [AccessibilityRole.ImageButton, android.widget.ImageButton.class.getName()],
770
- [AccessibilityRole.KeyboardKey, android.inputmethodservice.Keyboard.Key.class.getName()],
771
- [AccessibilityRole.StaticText, android.widget.TextView.class.getName()],
772
- [AccessibilityRole.Adjustable, android.widget.SeekBar.class.getName()],
773
- [AccessibilityRole.Checkbox, android.widget.CheckBox.class.getName()],
774
- [AccessibilityRole.RadioButton, android.widget.RadioButton.class.getName()],
775
- [AccessibilityRole.SpinButton, android.widget.Spinner.class.getName()],
776
- [AccessibilityRole.Switch, android.widget.Switch.class.getName()],
777
- [AccessibilityRole.ProgressBar, android.widget.ProgressBar.class.getName()],
778
- ]);
779
- clickableRolesMap = new Set([AccessibilityRole.Button, AccessibilityRole.ImageButton]);
780
- const ignoreRoleTypesForTrace = new Set([AccessibilityRole.Header, AccessibilityRole.Link, AccessibilityRole.None, AccessibilityRole.Summary]);
781
- var TNSAccessibilityDelegateImpl = /** @class */ (function (_super) {
782
- __extends(TNSAccessibilityDelegateImpl, _super);
783
- function TNSAccessibilityDelegateImpl() {
784
- var _this = _super.call(this) || this;
785
- return global.__native(_this);
786
- }
787
- TNSAccessibilityDelegateImpl.prototype.getTnsView = function (androidView) {
788
- var _a;
789
- var view = (_a = androidViewToTNSView.get(androidView)) === null || _a === void 0 ? void 0 : _a.get();
790
- if (!view) {
791
- androidViewToTNSView.delete(androidView);
792
- return null;
793
- }
794
- return view;
795
- };
796
- TNSAccessibilityDelegateImpl.prototype.onInitializeAccessibilityNodeInfo = function (host, info) {
797
- _super.prototype.onInitializeAccessibilityNodeInfo.call(this, host, info);
798
- var view = this.getTnsView(host);
799
- if (!view) {
800
- if (Trace.isEnabled()) {
801
- Trace.write("onInitializeAccessibilityNodeInfo ".concat(host, " ").concat(info, " no tns-view"), Trace.categories.Accessibility);
802
- }
803
- return;
804
- }
805
- // Set resource id that can be used with test frameworks without polluting the content description.
806
- var id = host.getTag(androidUtils.resources.getId(":id/nativescript_accessibility_id"));
807
- if (id != null) {
808
- info.setViewIdResourceName(id);
809
- }
810
- var accessibilityRole = view.accessibilityRole;
811
- if (accessibilityRole) {
812
- var androidClassName = RoleTypeMap.get(accessibilityRole);
813
- if (androidClassName) {
814
- var oldClassName = info.getClassName() || (SDK_VERSION >= 28 && host.getAccessibilityClassName()) || null;
815
- info.setClassName(androidClassName);
816
- if (Trace.isEnabled()) {
817
- Trace.write("".concat(view, ".accessibilityRole = \"").concat(accessibilityRole, "\" is mapped to \"").concat(androidClassName, "\" (was ").concat(oldClassName, "). ").concat(info.getClassName()), Trace.categories.Accessibility);
818
- }
819
- }
820
- else if (!ignoreRoleTypesForTrace.has(accessibilityRole)) {
821
- if (Trace.isEnabled()) {
822
- Trace.write("".concat(view, ".accessibilityRole = \"").concat(accessibilityRole, "\" is unknown"), Trace.categories.Accessibility);
823
- }
824
- }
825
- if (clickableRolesMap.has(accessibilityRole)) {
826
- if (Trace.isEnabled()) {
827
- Trace.write("onInitializeAccessibilityNodeInfo ".concat(view, " - set clickable role=").concat(accessibilityRole), Trace.categories.Accessibility);
828
- }
829
- info.setClickable(true);
830
- }
831
- if (SDK_VERSION >= 28) {
832
- if (accessibilityRole === AccessibilityRole.Header) {
833
- if (Trace.isEnabled()) {
834
- Trace.write("onInitializeAccessibilityNodeInfo ".concat(view, " - set heading role=").concat(accessibilityRole), Trace.categories.Accessibility);
835
- }
836
- info.setHeading(true);
837
- }
838
- else if (host.isAccessibilityHeading()) {
839
- if (Trace.isEnabled()) {
840
- Trace.write("onInitializeAccessibilityNodeInfo ".concat(view, " - set heading from host"), Trace.categories.Accessibility);
841
- }
842
- info.setHeading(true);
843
- }
844
- else {
845
- if (Trace.isEnabled()) {
846
- Trace.write("onInitializeAccessibilityNodeInfo ".concat(view, " - set not heading"), Trace.categories.Accessibility);
847
- }
848
- info.setHeading(false);
849
- }
850
- }
851
- switch (accessibilityRole) {
852
- case AccessibilityRole.Switch:
853
- case AccessibilityRole.RadioButton:
854
- case AccessibilityRole.Checkbox: {
855
- if (Trace.isEnabled()) {
856
- Trace.write("onInitializeAccessibilityNodeInfo ".concat(view, " - set checkable and check=").concat(view.accessibilityState === AccessibilityState.Checked), Trace.categories.Accessibility);
857
- }
858
- info.setCheckable(true);
859
- info.setChecked(view.accessibilityState === AccessibilityState.Checked);
860
- break;
861
- }
862
- default: {
863
- if (Trace.isEnabled()) {
864
- Trace.write("onInitializeAccessibilityNodeInfo ".concat(view, " - set enabled=").concat(view.accessibilityState !== AccessibilityState.Disabled, " and selected=").concat(view.accessibilityState === AccessibilityState.Selected), Trace.categories.Accessibility);
865
- }
866
- info.setEnabled(view.accessibilityState !== AccessibilityState.Disabled);
867
- info.setSelected(view.accessibilityState === AccessibilityState.Selected);
868
- break;
869
- }
870
- }
871
- }
872
- if (view.accessible) {
873
- info.setFocusable(true);
874
- }
875
- };
876
- TNSAccessibilityDelegateImpl.prototype.sendAccessibilityEvent = function (host, eventType) {
877
- _super.prototype.sendAccessibilityEvent.call(this, host, eventType);
878
- var view = this.getTnsView(host);
879
- if (!view) {
880
- console.log("skip - ".concat(host, " - ").concat(accessibilityEventTypeMap.get(eventType)));
881
- return;
882
- }
883
- try {
884
- accessibilityEventHelper(view, eventType);
885
- }
886
- catch (err) {
887
- console.error(err);
888
- }
889
- };
890
- return TNSAccessibilityDelegateImpl;
891
- }(AccessibilityDelegate));
892
- TNSAccessibilityDelegate = new TNSAccessibilityDelegateImpl();
893
- accessibilityEventMap = new Map([
894
- /**
895
- * Invalid selection/focus position.
896
- */
897
- [AndroidAccessibilityEvent.INVALID_POSITION, android.view.accessibility.AccessibilityEvent.INVALID_POSITION],
898
- /**
899
- * Maximum length of the text fields.
900
- */
901
- [AndroidAccessibilityEvent.MAX_TEXT_LENGTH, android.view.accessibility.AccessibilityEvent.MAX_TEXT_LENGTH],
902
- /**
903
- * Represents the event of clicking on a android.view.View like android.widget.Button, android.widget.CompoundButton, etc.
904
- */
905
- [AndroidAccessibilityEvent.VIEW_CLICKED, android.view.accessibility.AccessibilityEvent.TYPE_VIEW_CLICKED],
906
- /**
907
- * Represents the event of long clicking on a android.view.View like android.widget.Button, android.widget.CompoundButton, etc.
908
- */
909
- [AndroidAccessibilityEvent.VIEW_LONG_CLICKED, android.view.accessibility.AccessibilityEvent.TYPE_VIEW_LONG_CLICKED],
910
- /**
911
- * Represents the event of selecting an item usually in the context of an android.widget.AdapterView.
912
- */
913
- [AndroidAccessibilityEvent.VIEW_SELECTED, android.view.accessibility.AccessibilityEvent.TYPE_VIEW_SELECTED],
914
- /**
915
- * Represents the event of setting input focus of a android.view.View.
916
- */
917
- [AndroidAccessibilityEvent.VIEW_FOCUSED, android.view.accessibility.AccessibilityEvent.TYPE_VIEW_FOCUSED],
918
- /**
919
- * Represents the event of changing the text of an android.widget.EditText.
920
- */
921
- [AndroidAccessibilityEvent.VIEW_TEXT_CHANGED, android.view.accessibility.AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED],
922
- /**
923
- * Represents the event of opening a android.widget.PopupWindow, android.view.Menu, android.app.Dialog, etc.
924
- */
925
- [AndroidAccessibilityEvent.WINDOW_STATE_CHANGED, android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED],
926
- /**
927
- * Represents the event showing a android.app.Notification.
928
- */
929
- [AndroidAccessibilityEvent.NOTIFICATION_STATE_CHANGED, android.view.accessibility.AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED],
930
- /**
931
- * Represents the event of a hover enter over a android.view.View.
932
- */
933
- [AndroidAccessibilityEvent.VIEW_HOVER_ENTER, android.view.accessibility.AccessibilityEvent.TYPE_VIEW_HOVER_ENTER],
934
- /**
935
- * Represents the event of a hover exit over a android.view.View.
936
- */
937
- [AndroidAccessibilityEvent.VIEW_HOVER_EXIT, android.view.accessibility.AccessibilityEvent.TYPE_VIEW_HOVER_EXIT],
938
- /**
939
- * Represents the event of starting a touch exploration gesture.
940
- */
941
- [AndroidAccessibilityEvent.TOUCH_EXPLORATION_GESTURE_START, android.view.accessibility.AccessibilityEvent.TYPE_TOUCH_EXPLORATION_GESTURE_START],
942
- /**
943
- * Represents the event of ending a touch exploration gesture.
944
- */
945
- [AndroidAccessibilityEvent.TOUCH_EXPLORATION_GESTURE_END, android.view.accessibility.AccessibilityEvent.TYPE_TOUCH_EXPLORATION_GESTURE_END],
946
- /**
947
- * Represents the event of changing the content of a window and more specifically the sub-tree rooted at the event's source.
948
- */
949
- [AndroidAccessibilityEvent.WINDOW_CONTENT_CHANGED, android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED],
950
- /**
951
- * Represents the event of scrolling a view.
952
- */
953
- [AndroidAccessibilityEvent.VIEW_SCROLLED, android.view.accessibility.AccessibilityEvent.TYPE_VIEW_SCROLLED],
954
- /**
955
- * Represents the event of changing the selection in an android.widget.EditText.
956
- */
957
- [AndroidAccessibilityEvent.VIEW_TEXT_SELECTION_CHANGED, android.view.accessibility.AccessibilityEvent.TYPE_VIEW_TEXT_SELECTION_CHANGED],
958
- /**
959
- * Represents the event of an application making an announcement.
960
- */
961
- [AndroidAccessibilityEvent.ANNOUNCEMENT, android.view.accessibility.AccessibilityEvent.TYPE_ANNOUNCEMENT],
962
- /**
963
- * Represents the event of gaining accessibility focus.
964
- */
965
- [AndroidAccessibilityEvent.VIEW_ACCESSIBILITY_FOCUSED, android.view.accessibility.AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUSED],
966
- /**
967
- * Represents the event of clearing accessibility focus.
968
- */
969
- [AndroidAccessibilityEvent.VIEW_ACCESSIBILITY_FOCUS_CLEARED, android.view.accessibility.AccessibilityEvent.TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED],
970
- /**
971
- * Represents the event of traversing the text of a view at a given movement granularity.
972
- */
973
- [AndroidAccessibilityEvent.VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY, android.view.accessibility.AccessibilityEvent.TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY],
974
- /**
975
- * Represents the event of beginning gesture detection.
976
- */
977
- [AndroidAccessibilityEvent.GESTURE_DETECTION_START, android.view.accessibility.AccessibilityEvent.TYPE_GESTURE_DETECTION_START],
978
- /**
979
- * Represents the event of ending gesture detection.
980
- */
981
- [AndroidAccessibilityEvent.GESTURE_DETECTION_END, android.view.accessibility.AccessibilityEvent.TYPE_GESTURE_DETECTION_END],
982
- /**
983
- * Represents the event of the user starting to touch the screen.
984
- */
985
- [AndroidAccessibilityEvent.TOUCH_INTERACTION_START, android.view.accessibility.AccessibilityEvent.TYPE_TOUCH_INTERACTION_START],
986
- /**
987
- * Represents the event of the user ending to touch the screen.
988
- */
989
- [AndroidAccessibilityEvent.TOUCH_INTERACTION_END, android.view.accessibility.AccessibilityEvent.TYPE_TOUCH_INTERACTION_END],
990
- /**
991
- * Mask for AccessibilityEvent all types.
992
- */
993
- [AndroidAccessibilityEvent.ALL_MASK, android.view.accessibility.AccessibilityEvent.TYPES_ALL_MASK],
994
- ]);
995
- accessibilityEventTypeMap = new Map([...accessibilityEventMap].map(([k, v]) => [v, k]));
996
- }
997
- function updateAccessibilityServiceState() {
998
- const accessibilityManager = getAndroidAccessibilityManager();
999
- if (!accessibilityManager) {
1000
- return;
1001
- }
1002
- setA11yEnabled(!!accessibilityManager.isEnabled() && !!accessibilityManager.isTouchExplorationEnabled());
1003
- }
1004
- export function isAccessibilityServiceEnabled() {
1005
- const accessibilityServiceEnabled = isA11yEnabled();
1006
- if (typeof accessibilityServiceEnabled === 'boolean') {
1007
- return accessibilityServiceEnabled;
1008
- }
1009
- const accessibilityManager = getAndroidAccessibilityManager();
1010
- accessibilityStateChangeListener = new androidx.core.view.accessibility.AccessibilityManagerCompat.AccessibilityStateChangeListener({
1011
- onAccessibilityStateChanged(enabled) {
1012
- updateAccessibilityServiceState();
1013
- if (Trace.isEnabled()) {
1014
- Trace.write(`AccessibilityStateChangeListener state changed to: ${!!enabled}`, Trace.categories.Accessibility);
1015
- }
1016
- },
1017
- });
1018
- touchExplorationStateChangeListener = new androidx.core.view.accessibility.AccessibilityManagerCompat.TouchExplorationStateChangeListener({
1019
- onTouchExplorationStateChanged(enabled) {
1020
- updateAccessibilityServiceState();
1021
- if (Trace.isEnabled()) {
1022
- Trace.write(`TouchExplorationStateChangeListener state changed to: ${!!enabled}`, Trace.categories.Accessibility);
1023
- }
1024
- },
1025
- });
1026
- androidx.core.view.accessibility.AccessibilityManagerCompat.addAccessibilityStateChangeListener(accessibilityManager, accessibilityStateChangeListener);
1027
- androidx.core.view.accessibility.AccessibilityManagerCompat.addTouchExplorationStateChangeListener(accessibilityManager, touchExplorationStateChangeListener);
1028
- updateAccessibilityServiceState();
1029
- Application.on(Application.exitEvent, (args) => {
1030
- const activity = args.android;
1031
- if (activity && !activity.isFinishing()) {
1032
- return;
1033
- }
1034
- const accessibilityManager = getAndroidAccessibilityManager();
1035
- if (accessibilityManager) {
1036
- if (accessibilityStateChangeListener) {
1037
- androidx.core.view.accessibility.AccessibilityManagerCompat.removeAccessibilityStateChangeListener(accessibilityManager, accessibilityStateChangeListener);
1038
- }
1039
- if (touchExplorationStateChangeListener) {
1040
- androidx.core.view.accessibility.AccessibilityManagerCompat.removeTouchExplorationStateChangeListener(accessibilityManager, touchExplorationStateChangeListener);
1041
- }
1042
- }
1043
- accessibilityStateChangeListener = null;
1044
- touchExplorationStateChangeListener = null;
1045
- Application.off(Application.resumeEvent, updateAccessibilityServiceState);
1046
- });
1047
- Application.on(Application.resumeEvent, updateAccessibilityServiceState);
1048
- return accessibilityServiceEnabled;
1049
- }
1050
- let updateAccessibilityPropertiesMicroTask;
1051
- let pendingViews = new Set();
1052
- export function updateAccessibilityProperties(view) {
1053
- if (!view.nativeViewProtected) {
1054
- return;
1055
- }
1056
- pendingViews.add(view);
1057
- if (updateAccessibilityPropertiesMicroTask)
1058
- return;
1059
- updateAccessibilityPropertiesMicroTask = true;
1060
- Promise.resolve().then(() => {
1061
- updateAccessibilityPropertiesMicroTask = false;
1062
- let _pendingViews = Array.from(pendingViews);
1063
- pendingViews = new Set();
1064
- for (const view of _pendingViews) {
1065
- if (!view.nativeViewProtected)
1066
- continue;
1067
- setAccessibilityDelegate(view);
1068
- applyContentDescription(view);
1069
- }
1070
- _pendingViews = [];
1071
- });
1072
- }
1073
- setA11yUpdatePropertiesCallback(updateAccessibilityProperties);
1074
- export function sendAccessibilityEvent(view, eventType, text) {
1075
- if (!isAccessibilityServiceEnabled()) {
1076
- return;
1077
- }
1078
- const cls = `sendAccessibilityEvent(${view}, ${eventType}, ${text})`;
1079
- const androidView = view.nativeViewProtected;
1080
- if (!androidView) {
1081
- if (Trace.isEnabled()) {
1082
- Trace.write(`${cls}: no nativeView`, Trace.categories.Accessibility);
1083
- }
1084
- return;
1085
- }
1086
- if (!eventType) {
1087
- if (Trace.isEnabled()) {
1088
- Trace.write(`${cls}: no eventName provided`, Trace.categories.Accessibility);
1089
- }
1090
- return;
1091
- }
1092
- if (!isAccessibilityServiceEnabled()) {
1093
- if (Trace.isEnabled()) {
1094
- Trace.write(`${cls} - TalkBack not enabled`, Trace.categories.Accessibility);
1095
- }
1096
- return;
1097
- }
1098
- const accessibilityManager = getAndroidAccessibilityManager();
1099
- if (!accessibilityManager?.isEnabled()) {
1100
- if (Trace.isEnabled()) {
1101
- Trace.write(`${cls} - accessibility service not enabled`, Trace.categories.Accessibility);
1102
- }
1103
- return;
1104
- }
1105
- if (!accessibilityEventMap.has(eventType)) {
1106
- if (Trace.isEnabled()) {
1107
- Trace.write(`${cls} - unknown event`, Trace.categories.Accessibility);
1108
- }
1109
- return;
1110
- }
1111
- const eventInt = accessibilityEventMap.get(eventType);
1112
- if (!text) {
1113
- return androidView.sendAccessibilityEvent(eventInt);
1114
- }
1115
- const accessibilityEvent = android.view.accessibility.AccessibilityEvent.obtain(eventInt);
1116
- accessibilityEvent.setSource(androidView);
1117
- accessibilityEvent.getText().clear();
1118
- if (!text) {
1119
- applyContentDescription(view);
1120
- text = androidView.getContentDescription() || view['title'];
1121
- if (Trace.isEnabled()) {
1122
- Trace.write(`${cls} - text not provided use androidView.getContentDescription() - ${text}`, Trace.categories.Accessibility);
1123
- }
1124
- }
1125
- if (Trace.isEnabled()) {
1126
- Trace.write(`${cls}: send event with text: '${JSON.stringify(text)}'`, Trace.categories.Accessibility);
1127
- }
1128
- if (text) {
1129
- accessibilityEvent.getText().add(text);
1130
- }
1131
- accessibilityManager.sendAccessibilityEvent(accessibilityEvent);
1132
- }
1133
- function setAccessibilityDelegate(view) {
1134
- if (!view.nativeViewProtected) {
1135
- return;
1136
- }
1137
- ensureNativeClasses();
1138
- const androidView = view.nativeViewProtected;
1139
- if (!androidView || !androidView.setAccessibilityDelegate) {
1140
- return;
1141
- }
1142
- androidViewToTNSView.set(androidView, new WeakRef(view));
1143
- let hasOldDelegate = false;
1144
- if (typeof androidView.getAccessibilityDelegate === 'function') {
1145
- hasOldDelegate = androidView.getAccessibilityDelegate() === TNSAccessibilityDelegate;
1146
- }
1147
- if (hasOldDelegate) {
1148
- return;
1149
- }
1150
- androidView.setAccessibilityDelegate(TNSAccessibilityDelegate);
1151
- }
1152
- const applicationEvents = [Application.orientationChangedEvent, Application.systemAppearanceChangedEvent];
1153
- function toggleApplicationEventListeners(toAdd, callback) {
1154
- for (const eventName of applicationEvents) {
1155
- if (toAdd) {
1156
- Application.on(eventName, callback);
1157
- }
1158
- else {
1159
- Application.off(eventName, callback);
1160
- }
1161
- }
1162
- }
1163
- setToggleApplicationEventListenersCallback(toggleApplicationEventListeners);
1164
- setApplicationPropertiesCallback(() => {
1165
- return {
1166
- orientation: Application.orientation(),
1167
- systemAppearance: Application.systemAppearance(),
1168
- };
1169
- });
1170
- function onLiveSync(args) {
1171
- if (getImageFetcher()) {
1172
- getImageFetcher().clearCache();
1173
- }
1174
- }
1175
- getNativeScriptGlobals().events.on('livesync', onLiveSync);
1176
- getNativeScriptGlobals().addEventWiring(() => {
1177
- Application.android.on('activityStarted', (args) => {
1178
- if (!getImageFetcher()) {
1179
- initImageCache(args.activity);
1180
- }
1181
- else {
1182
- getImageFetcher().initCache();
1183
- }
1184
- });
1185
- });
1186
- getNativeScriptGlobals().addEventWiring(() => {
1187
- Application.android.on('activityStopped', (args) => {
1188
- if (getImageFetcher()) {
1189
- getImageFetcher().closeCache();
1190
- }
1191
- });
1192
- });
1193
514
  //# sourceMappingURL=application.android.js.map