@akylas/nativescript 9.1.4 → 9.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/application/application-common.d.ts +9 -3
  2. package/application/application-common.js +16 -3
  3. package/application/application-common.js.map +1 -1
  4. package/application/application.android.js +2 -6
  5. package/application/application.android.js.map +1 -1
  6. package/application/application.ios.js +8 -12
  7. package/application/application.ios.js.map +1 -1
  8. package/application/helpers-common.d.ts +2 -0
  9. package/application/helpers-common.js +23 -0
  10. package/application/helpers-common.js.map +1 -1
  11. package/config/config.interface.d.ts +1 -1
  12. package/config/config.interface.js.map +1 -1
  13. package/css-mediaquery/index.d.ts +6 -1
  14. package/css-mediaquery/index.js +31 -2
  15. package/css-mediaquery/index.js.map +1 -1
  16. package/debugger/webinspector-network.d.ts +29 -0
  17. package/fetch/index.d.ts +79 -0
  18. package/fetch/index.js +408 -0
  19. package/fetch/index.js.map +1 -0
  20. package/file-system/file-system-access.android.d.ts +1 -0
  21. package/file-system/file-system-access.android.js +18 -21
  22. package/file-system/file-system-access.android.js.map +1 -1
  23. package/global-types.d.ts +1 -1
  24. package/globals/index.js +4 -4
  25. package/globals/index.js.map +1 -1
  26. package/http/http-request/index.android.js +5 -1
  27. package/http/http-request/index.android.js.map +1 -1
  28. package/http/http-request-internal/http-request-internal-common.d.ts +1 -0
  29. package/http/http-request-internal/http-request-internal-common.js +9 -0
  30. package/http/http-request-internal/http-request-internal-common.js.map +1 -1
  31. package/http/http-request-internal/index.android.js +7 -5
  32. package/http/http-request-internal/index.android.js.map +1 -1
  33. package/http/http-request-internal/index.ios.js +33 -16
  34. package/http/http-request-internal/index.ios.js.map +1 -1
  35. package/image-source/index.ios.js +7 -6
  36. package/image-source/index.ios.js.map +1 -1
  37. package/index.d.ts +1 -1
  38. package/js-libs/easysax/easysax.d.ts +49 -7
  39. package/js-libs/easysax/easysax.js +631 -747
  40. package/js-libs/easysax/easysax.js.map +1 -0
  41. package/media-query-list/index.js +57 -15
  42. package/media-query-list/index.js.map +1 -1
  43. package/module-name-resolver/helpers.d.ts +1 -1
  44. package/module-name-resolver/helpers.js.map +1 -1
  45. package/module-name-resolver/index.d.ts +2 -2
  46. package/module-name-resolver/index.js.map +1 -1
  47. package/native-window/native-window.ios.js +3 -5
  48. package/native-window/native-window.ios.js.map +1 -1
  49. package/package.json +2 -3
  50. package/timer/index.android.js +2 -1
  51. package/timer/index.android.js.map +1 -1
  52. package/ui/action-bar/index.android.js +5 -4
  53. package/ui/action-bar/index.android.js.map +1 -1
  54. package/ui/animation/index.ios.js +6 -1
  55. package/ui/animation/index.ios.js.map +1 -1
  56. package/ui/builder/binding-builder.d.ts +8 -0
  57. package/ui/builder/binding-builder.js +12 -0
  58. package/ui/builder/binding-builder.js.map +1 -1
  59. package/ui/builder/component-builder/index.d.ts +7 -4
  60. package/ui/builder/component-builder/index.js +13 -7
  61. package/ui/builder/component-builder/index.js.map +1 -1
  62. package/ui/builder/index.d.ts +16 -2
  63. package/ui/builder/index.js +52 -12
  64. package/ui/builder/index.js.map +1 -1
  65. package/ui/button/index.android.js +4 -3
  66. package/ui/button/index.android.js.map +1 -1
  67. package/ui/content-view/index.js +2 -0
  68. package/ui/content-view/index.js.map +1 -1
  69. package/ui/core/bindable/bindable-types.d.ts +15 -0
  70. package/ui/core/bindable/bindable-types.js.map +1 -1
  71. package/ui/core/bindable/index.d.ts +1 -1
  72. package/ui/core/bindable/index.js +12 -7
  73. package/ui/core/bindable/index.js.map +1 -1
  74. package/ui/core/view/index.android.js +11 -9
  75. package/ui/core/view/index.android.js.map +1 -1
  76. package/ui/date-picker/index.android.js +1 -1
  77. package/ui/date-picker/index.android.js.map +1 -1
  78. package/ui/editable-text-base/index.android.d.ts +2 -0
  79. package/ui/editable-text-base/index.android.js +15 -6
  80. package/ui/editable-text-base/index.android.js.map +1 -1
  81. package/ui/editable-text-base/index.d.ts +8 -0
  82. package/ui/frame/fragment.transitions.android.d.ts +8 -5
  83. package/ui/frame/fragment.transitions.android.js +16 -18
  84. package/ui/frame/fragment.transitions.android.js.map +1 -1
  85. package/ui/frame/index.android.d.ts +1 -0
  86. package/ui/frame/index.android.js +10 -4
  87. package/ui/frame/index.android.js.map +1 -1
  88. package/ui/gestures/index.android.js +18 -9
  89. package/ui/gestures/index.android.js.map +1 -1
  90. package/ui/gestures/index.ios.js +6 -6
  91. package/ui/gestures/index.ios.js.map +1 -1
  92. package/ui/image/index.android.js +1 -1
  93. package/ui/image/index.android.js.map +1 -1
  94. package/ui/image-cache/index.android.js +1 -2
  95. package/ui/image-cache/index.android.js.map +1 -1
  96. package/ui/index.d.ts +1 -1
  97. package/ui/index.js.map +1 -1
  98. package/ui/list-picker/index.android.d.ts +1 -0
  99. package/ui/list-picker/index.android.js +6 -5
  100. package/ui/list-picker/index.android.js.map +1 -1
  101. package/ui/list-view/index.android.js +17 -9
  102. package/ui/list-view/index.android.js.map +1 -1
  103. package/ui/page/index.ios.js +7 -3
  104. package/ui/page/index.ios.js.map +1 -1
  105. package/ui/search-bar/index.android.js +2 -2
  106. package/ui/search-bar/index.android.js.map +1 -1
  107. package/ui/segmented-bar/index.android.js +8 -8
  108. package/ui/segmented-bar/index.android.js.map +1 -1
  109. package/ui/slider/index.android.js +1 -2
  110. package/ui/slider/index.android.js.map +1 -1
  111. package/ui/styling/background-common.js +2 -2
  112. package/ui/styling/background-common.js.map +1 -1
  113. package/ui/styling/background.d.ts +1 -1
  114. package/ui/styling/background.ios.d.ts +1 -1
  115. package/ui/styling/background.ios.js +1 -1
  116. package/ui/styling/background.ios.js.map +1 -1
  117. package/ui/styling/style/index.d.ts +13 -2
  118. package/ui/styling/style/index.js.map +1 -1
  119. package/ui/styling/style-scope.js +6 -0
  120. package/ui/styling/style-scope.js.map +1 -1
  121. package/ui/switch/index.android.js +1 -1
  122. package/ui/switch/index.android.js.map +1 -1
  123. package/ui/tab-view/index.android.js +9 -16
  124. package/ui/tab-view/index.android.js.map +1 -1
  125. package/ui/tab-view/index.ios.js +2 -2
  126. package/ui/tab-view/index.ios.js.map +1 -1
  127. package/ui/text-base/index.android.js +1 -1
  128. package/ui/text-base/index.android.js.map +1 -1
  129. package/ui/text-base/index.ios.js +1 -1
  130. package/ui/text-base/index.ios.js.map +1 -1
  131. package/ui/time-picker/index.android.js +1 -1
  132. package/ui/time-picker/index.android.js.map +1 -1
  133. package/ui/transition/page-transition.android.js +0 -44
  134. package/ui/transition/page-transition.android.js.map +1 -1
  135. package/ui/web-view/index.android.js +1 -1
  136. package/ui/web-view/index.android.js.map +1 -1
  137. package/utils/android-runtime-version.d.ts +12 -0
  138. package/utils/android-runtime-version.js +36 -0
  139. package/utils/android-runtime-version.js.map +1 -0
  140. package/utils/native-helper-for-android.js +3 -1
  141. package/utils/native-helper-for-android.js.map +1 -1
  142. package/xhr/index.d.ts +5 -4
  143. package/xhr/index.js +18 -18
  144. package/xhr/index.js.map +1 -1
  145. package/xml/index.d.ts +2 -2
  146. package/xml/index.js +1 -1
  147. package/xml/index.js.map +1 -1
  148. package/LICENSE +0 -19
  149. package/fetch/index.mjs +0 -535
@@ -1 +1 @@
1
- {"version":3,"file":"index.ios.js","sourceRoot":"","sources":["../../../../../packages/core/ui/page/index.ios.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,uBAAuB,EAAE,iCAAiC,EAAE,MAAM,eAAe,CAAC;AAErG,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC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,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;YAErG,OAAO;QACR,CAAC;QAED,+BAA+B,CAAC,wCAAwC,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;IACrG,CAAC;CACD;AAED,SAAS,2BAA2B,CAAC,UAA4B;IAChE,IAAI,CAAC,UAAU,EAAE,CAAC;QACjB,OAAO;IACR,CAAC;IAED,UAAU,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;IAEjC,MAAM,uBAAuB,GAAG,UAAU,CAAC,uBAAuB,CAAC;IACnE,IAAI,uBAAuB,EAAE,CAAC;QAC7B,OAAO,2BAA2B,CAAC,uBAAuB,CAAC,CAAC;IAC7D,CAAC;IAED,MAAM,gBAAgB,GAAG,UAAU,CAAC,oBAAoB,CAAC;IACzD,IAAI,IAAI,GAAG,UAAU,CAAC,oBAAoB,CAAC,KAAK,CAAC;IACjD,OAAO,IAAI,GAAG,CAAC,EAAE,CAAC;QACjB,MAAM,eAAe,GAAG,gBAAgB,CAAC,EAAE,IAAI,CAAC,CAAC;QACjD,IAAI,eAAe,YAAY,kBAAkB,EAAE,CAAC;YACnD,2BAA2B,CAAC,eAAe,CAAC,sBAAsB,CAAC,CAAC;QACrE,CAAC;aAAM,IAAI,eAAe,YAAY,sBAAsB,EAAE,CAAC;YAC9D,2BAA2B,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC;QAChE,CAAC;aAAM,IAAI,eAAe,YAAY,qBAAqB,EAAE,CAAC;YAC7D,2BAA2B,CAAC,eAAe,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;QACzE,CAAC;aAAM,CAAC;YACP,2BAA2B,CAAC,eAAe,CAAC,CAAC;QAC9C,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["import type { Frame } from '../frame';\nimport { BackstackEntry, NavigationType } from '../frame/frame-interfaces';\nimport { View, IOSHelper } from '../core/view';\nimport { PageBase, actionBarHiddenProperty, enableSwipeBackNavigationProperty } from './page-common';\n\nimport { profile } from '../../profiling';\nimport { layout } from '../../utils/layout-helper';\nimport { SDK_VERSION } from '../../utils/constants';\nimport { getLastFocusedViewOnPage } from '../../accessibility/accessibility-common';\nimport { SharedTransition } from '../transition/shared-transition';\nimport { isAccessibilityServiceEnabled } from '../../accessibility';\n\nexport * from './page-common';\n\nconst ENTRY = '_entry';\nconst DELEGATE = '_delegate';\nconst TRANSITION = '_transition';\nconst NON_ANIMATED_TRANSITION = 'non-animated';\n\n@NativeClass\nclass UIViewControllerImpl extends UIViewController {\n\t// TODO: a11y\n\t// static ObjCExposedMethods = {\n\t// \taccessibilityPerformEscape: { returns: interop.types.bool, params: [interop.types.void] },\n\t// };\n\tprivate _owner: WeakRef<Page>;\n\n\tpublic isBackstackSkipped: boolean;\n\tpublic isBackstackCleared: boolean;\n\t// private didFirstLayout: boolean;\n\t// this is initialized in initWithOwner since the constructor doesn't run on native classes\n\t// private _isRunningLayout: number;\n\t// private get isRunningLayout() {\n\t// \treturn this._isRunningLayout !== 0;\n\t// }\n\t// private startRunningLayout() {\n\t// \tthis._isRunningLayout++;\n\t// }\n\t// private finishRunningLayout() {\n\t// \tthis._isRunningLayout--;\n\t// \tthis.clearScheduledLayout();\n\t// }\n\t// private runLayout(cb: () => void) {\n\t// \ttry {\n\t// \t\tthis.startRunningLayout();\n\t// \t\tcb();\n\t// \t} finally {\n\t// \t\tthis.finishRunningLayout();\n\t// \t}\n\t// }\n\n\t// layoutTimer: number;\n\n\t// private clearScheduledLayout() {\n\t// \tif (this.layoutTimer) {\n\t// \t\tclearTimeout(this.layoutTimer);\n\t// \t\tthis.layoutTimer = null;\n\t// \t}\n\t// }\n\n\t// private scheduleLayout() {\n\t// \tif (this.layoutTimer) {\n\t// \t\treturn;\n\t// \t}\n\t// \tsetTimeout(() => {\n\t// \t\tthis.layoutTimer = null;\n\t// \t\tif (!this.isRunningLayout) {\n\t// \t\t\tthis.runLayout(() => this.layoutOwner());\n\t// \t\t}\n\t// \t});\n\t// }\n\n\tpublic static initWithOwner(owner: WeakRef<Page>): UIViewControllerImpl {\n\t\tconst controller = <UIViewControllerImpl>UIViewControllerImpl.new();\n\t\tcontroller._owner = owner;\n\t\t// controller._isRunningLayout = 0;\n\n\t\treturn controller;\n\t}\n\n\tpublic viewDidLoad(): void {\n\t\tsuper.viewDidLoad();\n\n\t\t// Unify translucent and opaque bars layout\n\t\t// this.edgesForExtendedLayout = UIRectEdgeBottom;\n\t\tthis.extendedLayoutIncludesOpaqueBars = true;\n\t}\n\n\tpublic viewWillAppear(animated: boolean): void {\n\t\tsuper.viewWillAppear(animated);\n\t\tconst owner = this._owner?.deref();\n\t\tif (!owner) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst frame: Frame = this.navigationController ? (<any>this.navigationController).owner : null;\n\n\t\tif (frame) {\n\t\t\tconst entry: BackstackEntry = this[ENTRY];\n\t\t\tconst currentPage = frame.currentPage;\n\n\t\t\t// Don't raise event if currentPage was showing modal page.\n\t\t\tif (!owner._presentedViewController && entry && currentPage !== owner && !frame._executingContext) {\n\t\t\t\tconst isBack: boolean = frame.backStack.includes(entry);\n\n\t\t\t\tframe._executingContext = {\n\t\t\t\t\tentry,\n\t\t\t\t\tisBackNavigation: isBack,\n\t\t\t\t\tnavigationType: isBack ? NavigationType.back : NavigationType.forward,\n\t\t\t\t};\n\t\t\t\tframe._onNavigatingTo(entry, isBack);\n\t\t\t}\n\n\t\t\tframe._resolvedPage = owner;\n\n\t\t\tif (owner.parent === frame) {\n\t\t\t\tframe._inheritStyles(owner);\n\t\t\t} else {\n\t\t\t\tif (!owner.parent) {\n\t\t\t\t\tif (!frame._styleScope) {\n\t\t\t\t\t\t// Make sure page will have styleScope even if frame doesn't.\n\t\t\t\t\t\towner._updateStyleScope();\n\t\t\t\t\t}\n\n\t\t\t\t\tframe._addView(owner);\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error('Page is already shown on another frame.');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tframe._updateActionBar(owner);\n\t\t}\n\n\t\t// Set autoAdjustScrollInsets in will appear - as early as possible\n\t\tIOSHelper.updateAutoAdjustScrollInsets(this, owner);\n\n\t\t// Pages in backstack are unloaded so raise loaded here.\n\t\tif (!owner.isLoaded) {\n\t\t\towner.callLoaded();\n\t\t\t// On first appearance, apply status bar style after the page is attached to the frame/nav stack.\n\t\t\towner.updateStatusBar();\n\t\t} else {\n\t\t\t// Note: Handle the case of canceled backstack navigation. (https://github.com/NativeScript/NativeScript/issues/7430)\n\t\t\t// In this case viewWillAppear will be executed for the previous page and it will change the ActionBar\n\t\t\t// because changes happen in an interactive transition - IOS will animate between the the states.\n\t\t\t// If canceled - viewWillAppear will be called for the current page(which is already loaded) and we need to\n\t\t\t// update the action bar explicitly, so that it is not left styles as the previous page.\n\t\t\towner.updateWithWillAppear(animated);\n\t\t}\n\t}\n\n\t@profile\n\tpublic viewDidAppear(animated: boolean): void {\n\t\tsuper.viewDidAppear(animated);\n\n\t\tconst owner = this._owner?.deref();\n\t\tif (!owner) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst navigationController = this.navigationController;\n\t\tconst frame: Frame = navigationController ? (<any>navigationController).owner : null;\n\t\tif (frame) {\n\t\t\tconst newEntry: BackstackEntry = this[ENTRY];\n\n\t\t\t// There are cases like swipe back navigation that can be cancelled.\n\t\t\t// When that's the case, stop here and unset executing context.\n\t\t\tif (frame._executingContext && frame._executingContext.entry !== newEntry) {\n\t\t\t\tframe._executingContext = null;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Skip navigation events if modal page is shown.\n\t\t\tif (!owner._presentedViewController) {\n\t\t\t\t// frame.setCurrent(...) will reset executing context so retrieve it here\n\t\t\t\tconst navigationType = frame._executingContext?.navigationType ?? NavigationType.back;\n\t\t\t\tconst isReplace = navigationType === NavigationType.replace;\n\n\t\t\t\tframe.setCurrent(newEntry, navigationType);\n\n\t\t\t\tif (isReplace) {\n\t\t\t\t\tconst controller = newEntry.resolvedPage.ios;\n\t\t\t\t\tif (controller) {\n\t\t\t\t\t\tconst animated = frame._getIsAnimatedNavigation(newEntry.entry);\n\t\t\t\t\t\tif (animated) {\n\t\t\t\t\t\t\tcontroller[TRANSITION] = frame._getNavigationTransition(newEntry.entry);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcontroller[TRANSITION] = {\n\t\t\t\t\t\t\t\tname: NON_ANIMATED_TRANSITION,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If page was shown with custom animation - we need to set the navigationController.delegate to the animatedDelegate.\n\t\t\t\tif (frame.ios?.controller) {\n\t\t\t\t\tframe.ios.controller.delegate = this[DELEGATE];\n\t\t\t\t}\n\n\t\t\t\tframe._processNavigationQueue(owner);\n\n\t\t\t\tif (!__VISIONOS__) {\n\t\t\t\t\t// _processNavigationQueue will shift navigationQueue. Check canGoBack after that.\n\t\t\t\t\t// Workaround for disabled backswipe on second custom native transition\n\t\t\t\t\tif (frame.canGoBack()) {\n\t\t\t\t\t\tconst transitionState = SharedTransition.getState(owner.transitionId);\n\t\t\t\t\t\tif (transitionState?.interactive) {\n\t\t\t\t\t\t\t// A custom interactive dismiss is wired up (shared transition with\n\t\t\t\t\t\t\t// pan gesture). Disable iOS' built-in edge pan so it can't race the\n\t\t\t\t\t\t\t// custom recognizer and run the standard non-interactive pop.\n\t\t\t\t\t\t\tnavigationController.interactivePopGestureRecognizer.enabled = false;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// only consider when interactive transitions are not enabled\n\t\t\t\t\t\t\tnavigationController.interactivePopGestureRecognizer.delegate = navigationController;\n\t\t\t\t\t\t\tnavigationController.interactivePopGestureRecognizer.enabled = owner.enableSwipeBackNavigation;\n\t\t\t\t\t\t\tif (SDK_VERSION >= 26 && navigationController.interactiveContentPopGestureRecognizer) {\n\t\t\t\t\t\t\t\tnavigationController.interactiveContentPopGestureRecognizer.enabled = owner.enableSwipeBackNavigation;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnavigationController.interactivePopGestureRecognizer.enabled = false;\n\t\t\t\t\t\tif (SDK_VERSION >= 26 && navigationController.interactiveContentPopGestureRecognizer) {\n\t\t\t\t\t\t\tnavigationController.interactiveContentPopGestureRecognizer.enabled = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// TODO: testing without the check. Does not seem necessary and have very bad side effects.\n\t\t// if (!this.presentedViewController) {\n\t\t\t// clear presented viewController here only if no presented controller.\n\t\t\t// this is needed because in iOS9 the order of events could be - willAppear, willDisappear, didAppear.\n\t\t\t// If we clean it when we have viewController then once presented VC is dismissed then\n\t\t\towner._presentedViewController = null;\n\t\t// }\n\t}\n\n\t@profile\n\tpublic viewWillDisappear(animated: boolean): void {\n\t\tsuper.viewWillDisappear(animated);\n\n\t\tconst owner = this._owner?.deref();\n\t\tif (!owner) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Cache presentedViewController if any. We don't want to raise\n\t\t// navigation events in case of presenting view controller.\n\t\tif (!owner._presentedViewController) {\n\t\t\towner._presentedViewController = this.presentedViewController;\n\t\t}\n\n\t\towner.updateWithWillDisappear(animated);\n\t}\n\n\t@profile\n\tpublic viewDidDisappear(animated: boolean): void {\n\t\tsuper.viewDidDisappear(animated);\n\n\t\tconst owner = this._owner?.deref();\n\n\t\t// Exit if no page or page is hiding because it shows another page modally.\n\t\tif (!owner || owner.modal || owner._presentedViewController) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Forward navigation does not remove page from frame so we raise unloaded manually.\n\t\tif (owner.isLoaded) {\n\t\t\towner.callUnloaded();\n\t\t}\n\t}\n\n\tpublic viewWillLayoutSubviews(): void {\n\t\tsuper.viewWillLayoutSubviews();\n\t\tconst owner = this._owner?.deref();\n\t\tif (owner) {\n\t\t\tIOSHelper.updateConstraints(this, owner);\n\t\t}\n\t}\n\n\tpublic viewSafeAreaInsetsDidChange(): void {\n\t\tsuper.viewSafeAreaInsetsDidChange();\n\t\t// if (this.isRunningLayout || !this.didFirstLayout) {\n\t\t// \treturn;\n\t\t// }\n\t\t// const owner = this._owner?.deref();\n\t\t// if (owner) {\n\t\t// \tthis.runLayout(() => IOSHelper.layoutView(this, owner));\n\t\t// }\n\t}\n\n\tpublic viewDidLayoutSubviews(): void {\n\t\t// this.startRunningLayout();\n\t\tsuper.viewDidLayoutSubviews();\n\t\tconst owner = this._owner?.deref();\n\t\tif (owner) {\n\t\t\t// layout(owner.actionBar)\n\t\t\t// layout(owner.content)\n\n\t\t\tif (SDK_VERSION >= 11) {\n\t\t\t\t// Handle nested Page safe area insets application.\n\t\t\t\t// A Page is nested if its Frame has a parent.\n\t\t\t\t// If the Page is nested, cross check safe area insets on top and bottom with Frame parent.\n\t\t\t\tconst frame = owner.parent;\n\t\t\t\t// There is a legacy scenario where Page is not in a Frame - the root of a Modal View, so it has no parent.\n\t\t\t\tlet frameParent = frame && frame.parent;\n\n\t\t\t\t// Handle Angular scenario where TabView is in a ProxyViewContainer\n\t\t\t\t// It is possible to wrap components in ProxyViewContainers indefinitely\n\t\t\t\t// Not using instanceof ProxyViewContainer to avoid circular dependency\n\t\t\t\t// TODO: Try moving UIViewControllerImpl out of page module\n\t\t\t\twhile (frameParent && !frameParent.nativeViewProtected) {\n\t\t\t\t\tframeParent = frameParent.parent;\n\t\t\t\t}\n\n\t\t\t\tif (frameParent) {\n\t\t\t\t\tconst parentPageInsetsTop = frameParent.nativeViewProtected.safeAreaInsets.top;\n\t\t\t\t\tconst parentPageInsetsBottom = frameParent.nativeViewProtected.safeAreaInsets.bottom;\n\t\t\t\t\tlet currentInsetsTop = this.view.safeAreaInsets.top;\n\t\t\t\t\tlet currentInsetsBottom = this.view.safeAreaInsets.bottom;\n\n\t\t\t\t\t// Safe area insets include additional safe area insets too, so subtract old values\n\t\t\t\t\tif (this.additionalSafeAreaInsets) {\n\t\t\t\t\t\tcurrentInsetsTop -= this.additionalSafeAreaInsets.top;\n\t\t\t\t\t\tcurrentInsetsBottom -= this.additionalSafeAreaInsets.bottom;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst additionalInsetsTop = Math.max(parentPageInsetsTop - currentInsetsTop, 0);\n\t\t\t\t\tconst additionalInsetsBottom = Math.max(parentPageInsetsBottom - currentInsetsBottom, 0);\n\n\t\t\t\t\tif (additionalInsetsTop > 0 || additionalInsetsBottom > 0) {\n\t\t\t\t\t\tconst additionalInsets = new UIEdgeInsets({\n\t\t\t\t\t\t\ttop: additionalInsetsTop,\n\t\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\t\tbottom: additionalInsetsBottom,\n\t\t\t\t\t\t\tright: 0,\n\t\t\t\t\t\t});\n\t\t\t\t\t\tthis.additionalSafeAreaInsets = additionalInsets;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.additionalSafeAreaInsets = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tIOSHelper.layoutView(this, owner);\n\t\t}\n\t\t// this.finishRunningLayout();\n\t}\n\n\t// Mind implementation for other controllerss\n\tpublic traitCollectionDidChange(previousTraitCollection: UITraitCollection): void {\n\t\tsuper.traitCollectionDidChange(previousTraitCollection);\n\n\t\tconst owner = this._owner?.deref();\n\t\tif (owner) {\n\t\t\tif (SDK_VERSION >= 13) {\n\t\t\t\tif (this.traitCollection.hasDifferentColorAppearanceComparedToTraitCollection && this.traitCollection.hasDifferentColorAppearanceComparedToTraitCollection(previousTraitCollection)) {\n\t\t\t\t\towner.notify({\n\t\t\t\t\t\teventName: IOSHelper.traitCollectionColorAppearanceChangedEvent,\n\t\t\t\t\t\tobject: owner,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.traitCollection.layoutDirection !== previousTraitCollection.layoutDirection) {\n\t\t\t\towner.notify({\n\t\t\t\t\teventName: IOSHelper.traitCollectionLayoutDirectionChangedEvent,\n\t\t\t\t\tobject: owner,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic accessibilityPerformEscape() {\n\t\tconst owner = this._owner?.deref();\n\t\tif (owner?.onAccessibilityPerformEscape) {\n\t\t\tconst result = owner.onAccessibilityPerformEscape();\n\t\t\treturn result;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// @ts-ignore\n\tpublic get preferredStatusBarStyle(): UIStatusBarStyle {\n\t\tconst owner = this._owner?.deref();\n\t\tif (owner?.statusBarStyle) {\n\t\t\tif (SDK_VERSION >= 13) {\n\t\t\t\treturn owner.statusBarStyle === 'light' ? UIStatusBarStyle.LightContent : UIStatusBarStyle.DarkContent;\n\t\t\t} else {\n\t\t\t\treturn owner.statusBarStyle === 'light' ? UIStatusBarStyle.LightContent : UIStatusBarStyle.Default;\n\t\t\t}\n\t\t}\n\t\treturn UIStatusBarStyle.Default;\n\t}\n}\n\nexport class Page extends PageBase {\n\tdeclare nativeViewProtected: UIView;\n\tdeclare viewController: UIViewControllerImpl;\n\tonAccessibilityPerformEscape: () => boolean;\n\n\tprivate _backgroundColor = SDK_VERSION <= 12 && !UIColor.systemBackgroundColor ? UIColor.whiteColor : UIColor.systemBackgroundColor;\n\tprivate _ios: UIViewControllerImpl;\n\tpublic _presentedViewController: UIViewController; // used when our page present native viewController without going through our abstraction.\n\n\tconstructor() {\n\t\tsuper();\n\t\tconst controller = UIViewControllerImpl.initWithOwner(new WeakRef(this));\n\t\tcontroller.view.backgroundColor = this._backgroundColor;\n\t\tthis.viewController = this._ios = controller;\n\t}\n\n\tcreateNativeView() {\n\t\t// View controller can be disposed during view disposal, so make sure to create a new one if not defined\n\t\tif (!this._ios) {\n\t\t\tconst controller = UIViewControllerImpl.initWithOwner(new WeakRef(this));\n\t\t\tcontroller.view.backgroundColor = this._backgroundColor;\n\t\t\tthis.viewController = this._ios = controller;\n\t\t}\n\t\treturn this._ios.view;\n\t}\n\n\tdisposeNativeView() {\n\t\tthis.viewController = null;\n\t\tthis._ios = null;\n\t\tsuper.disposeNativeView();\n\t}\n\n\t// @ts-ignore\n\tget ios(): UIViewController {\n\t\treturn this._ios;\n\t}\n\n\tpublic layoutNativeView(left: number, top: number, right: number, bottom: number): void {\n\t\tconst nativeView = this.nativeViewProtected;\n\t\tif (!nativeView) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentFrame = nativeView.frame;\n\t\t// Create a copy of current view frame\n\t\tconst newFrame = CGRectMake(currentFrame.origin.x, currentFrame.origin.y, currentFrame.size.width, currentFrame.size.height);\n\n\t\tthis._setNativeViewFrame(nativeView, newFrame);\n\t}\n\n\tpublic _modifyNativeViewFrame(nativeView: UIView, frame: CGRect) {\n\t\t//\n\t}\n\n\tpublic _shouldDelayLayout(): boolean {\n\t\treturn this.frame && this.frame._animationInProgress;\n\t}\n\n\tpublic onLoaded(): void {\n\t\tsuper.onLoaded();\n\t\tif (this.hasActionBar) {\n\t\t\tthis.actionBar.update();\n\t\t}\n\t}\n\tupdateWithWillAppear(animated: boolean) {\n\t\t// this method is important because it allows plugins to react to modal page close\n\t\t// for example allowing updating status bar background color\n\t\tif (this.hasActionBar) {\n\t\t\tthis.actionBar.update();\n\t\t}\n\t\tthis.updateStatusBar();\n\t}\n\n\tupdateWithWillDisappear(animated: boolean) {\n\t\t// this method is important because it allows plugins to react to modal page close\n\t\t// for example allowing updating status bar background color\n\t}\n\n\tpublic updateStatusBar() {\n\t\tthis._updateStatusBarStyle(this.statusBarStyle);\n\t}\n\n\tpublic _updateStatusBarStyle(value?: string) {\n\t\tconst frame = this.frame;\n\t\tif (frame?.ios && value) {\n\t\t\tconst navigationController: UINavigationController = frame.ios.controller;\n\t\t\tIOSHelper.invalidateStatusBarAppearance(navigationController, `Page._updateStatusBarStyle:${value}`);\n\t\t}\n\t}\n\n\tpublic _updateEnableSwipeBackNavigation(enabled: boolean) {\n\t\tconst navController = this._ios.navigationController;\n\t\tif (this.frame && navController) {\n\t\t\t// Make sure we don't set true if cannot go back\n\t\t\tenabled = enabled && this.frame.canGoBack();\n\t\t\tif (navController.interactivePopGestureRecognizer) {\n\t\t\t\tnavController.interactivePopGestureRecognizer.enabled = enabled;\n\t\t\t}\n\n\t\t\tif (SDK_VERSION >= 26 && navController.interactiveContentPopGestureRecognizer) {\n\t\t\t\tnavController.interactiveContentPopGestureRecognizer.enabled = enabled;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic onMeasure(widthMeasureSpec: number, heightMeasureSpec: number) {\n\t\tconst width = layout.getMeasureSpecSize(widthMeasureSpec);\n\t\tconst widthMode = layout.getMeasureSpecMode(widthMeasureSpec);\n\n\t\tconst height = layout.getMeasureSpecSize(heightMeasureSpec);\n\t\tconst heightMode = layout.getMeasureSpecMode(heightMeasureSpec);\n\n\t\tif (this.hasActionBar && this.frame && this.frame._getNavBarVisible(this)) {\n\t\t\tconst { width, height } = this.actionBar._getActualSize;\n\t\t\tconst widthSpec = layout.makeMeasureSpec(width, layout.EXACTLY);\n\t\t\tconst heightSpec = layout.makeMeasureSpec(height, layout.EXACTLY);\n\t\t\tView.measureChild(this, this.actionBar, widthSpec, heightSpec);\n\t\t}\n\n\t\tconst result = View.measureChild(this, this.layoutView, widthMeasureSpec, heightMeasureSpec);\n\n\t\tconst measureWidth = Math.max(result.measuredWidth, this.effectiveMinWidth);\n\t\tconst measureHeight = Math.max(result.measuredHeight, this.effectiveMinHeight);\n\n\t\tconst widthAndState = View.resolveSizeAndState(measureWidth, width, widthMode, 0);\n\t\tconst heightAndState = View.resolveSizeAndState(measureHeight, height, heightMode, 0);\n\n\t\tthis.setMeasuredDimension(widthAndState, heightAndState);\n\t}\n\n\tpublic onLayout(left: number, top: number, right: number, bottom: number) {\n\t\tif (this.hasActionBar) {\n\t\t\tconst { width: actionBarWidth, height: actionBarHeight } = this.actionBar._getActualSize;\n\t\t\tView.layoutChild(this, this.actionBar, 0, 0, actionBarWidth, actionBarHeight);\n\t\t}\n\n\t\tconst insets = this.getSafeAreaInsets();\n\n\t\tif (!__VISIONOS__ && SDK_VERSION <= 10 && this.viewController) {\n\t\t\t// iOS 10 and below don't have safe area insets API,\n\t\t\t// there we need only the top inset on the Page\n\t\t\tinsets.top = layout.round(layout.toDevicePixels(this.viewController.view.safeAreaLayoutGuide.layoutFrame.origin.y));\n\t\t}\n\n\t\tconst childLeft = 0 + insets.left;\n\t\tconst childTop = 0 + insets.top;\n\t\tconst childRight = right - insets.right;\n\t\tconst childBottom = bottom - insets.bottom;\n\n\t\tView.layoutChild(this, this.layoutView, childLeft, childTop, childRight, childBottom);\n\t}\n\n\tpublic _addViewToNativeVisualTree(child: View, atIndex: number): boolean {\n\t\t// ActionBar is handled by the UINavigationController\n\t\tif (this.hasActionBar && child === this.actionBar) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst nativeParent = this.nativeViewProtected;\n\t\tconst nativeChild = child.nativeViewProtected;\n\n\t\tconst viewController = child.ios instanceof UIViewController ? child.ios : child.viewController;\n\t\tif (viewController) {\n\t\t\t// Adding modal controllers to as child will make app freeze.\n\t\t\tif (this.viewController.presentedViewController === viewController) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tthis.viewController.addChildViewController(viewController);\n\t\t}\n\n\t\tif (nativeParent && nativeChild) {\n\t\t\tIOSHelper.insertNativeSubview(nativeParent, nativeChild, atIndex);\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tpublic _removeViewFromNativeVisualTree(child: View): void {\n\t\t// ActionBar is handled by the UINavigationController\n\t\tif (this.hasActionBar && child === this.actionBar) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst viewController = child.ios instanceof UIViewController ? child.ios : child.viewController;\n\t\tif (viewController) {\n\t\t\tviewController.removeFromParentViewController();\n\t\t}\n\n\t\tsuper._removeViewFromNativeVisualTree(child);\n\t}\n\n\t[actionBarHiddenProperty.setNative](value: boolean) {\n\t\t// Invalidate all inner controller.\n\t\tinvalidateTopmostController(this.viewController);\n\n\t\tconst frame = this.frame;\n\t\tif (frame) {\n\t\t\t// Update nav-bar visibility with disabled animations\n\t\t\tframe._updateActionBar(this, true);\n\t\t}\n\t}\n\n\t[enableSwipeBackNavigationProperty.setNative](value: boolean) {\n\t\tthis._updateEnableSwipeBackNavigation(value);\n\t}\n\n\tpublic accessibilityScreenChanged(refocus = false): void {\n\t\tif (!isAccessibilityServiceEnabled()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (refocus) {\n\t\t\tconst lastFocusedView = getLastFocusedViewOnPage(this);\n\t\t\tif (lastFocusedView) {\n\t\t\t\tconst uiView = lastFocusedView.nativeViewProtected;\n\t\t\t\tif (uiView) {\n\t\t\t\t\tUIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, uiView);\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.actionBarHidden) {\n\t\t\tUIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, this.nativeViewProtected);\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.accessibilityLabel) {\n\t\t\tUIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, this.nativeViewProtected);\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.hasActionBar && (this.actionBar.accessibilityLabel || this.actionBar.title)) {\n\t\t\tUIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, this.actionBar.nativeView);\n\n\t\t\treturn;\n\t\t}\n\n\t\tUIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, this.nativeViewProtected);\n\t}\n}\n\nfunction invalidateTopmostController(controller: UIViewController): void {\n\tif (!controller) {\n\t\treturn;\n\t}\n\n\tcontroller.view.setNeedsLayout();\n\n\tconst presentedViewController = controller.presentedViewController;\n\tif (presentedViewController) {\n\t\treturn invalidateTopmostController(presentedViewController);\n\t}\n\n\tconst childControllers = controller.childViewControllers;\n\tlet size = controller.childViewControllers.count;\n\twhile (size > 0) {\n\t\tconst childController = childControllers[--size];\n\t\tif (childController instanceof UITabBarController) {\n\t\t\tinvalidateTopmostController(childController.selectedViewController);\n\t\t} else if (childController instanceof UINavigationController) {\n\t\t\tinvalidateTopmostController(childController.topViewController);\n\t\t} else if (childController instanceof UISplitViewController) {\n\t\t\tinvalidateTopmostController(childController.viewControllers.lastObject);\n\t\t} else {\n\t\t\tinvalidateTopmostController(childController);\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"index.ios.js","sourceRoot":"","sources":["../../../../../packages/core/ui/page/index.ios.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,uBAAuB,EAAE,iCAAiC,EAAE,MAAM,eAAe,CAAC;AAErG,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AAEpE,cAAc,eAAe,CAAC;AAE9B,MAAM,KAAK,GAAG,QAAQ,CAAC;AACvB,MAAM,QAAQ,GAAG,WAAW,CAAC;AAC7B,MAAM,UAAU,GAAG,aAAa,CAAC;AACjC,MAAM,uBAAuB,GAAG,cAAc,CAAC;;;;;IAdO,CAAC;;mDAmCtD,kCAAkC;QAClC,4BAA4B;QAC5B,gCAAgC;QAChC,IAAI;QACJ,sCAAsC;QACtC,SAAS;QACT,+BAA+B;QAC/B,UAAU;QACV,eAAe;QACf,gCAAgC;QAChC,KAAK;QACL,IAAI;QAEJ,uBAAuB;QAEvB,mCAAmC;QACnC,2BAA2B;QAC3B,oCAAoC;QACpC,6BAA6B;QAC7B,KAAK;QACL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zD,IAAI,IAAI,GAAG,UAAU,CAAC,oBAAoB,CAAC,KAAK,CAAC;IACjD,OAAO,IAAI,GAAG,CAAC,EAAE,CAAC;QACjB,MAAM,eAAe,GAAG,gBAAgB,CAAC,EAAE,IAAI,CAAC,CAAC;QACjD,IAAI,eAAe,YAAY,kBAAkB,EAAE,CAAC;YACnD,2BAA2B,CAAC,eAAe,CAAC,sBAAsB,CAAC,CAAC;QACrE,CAAC;aAAM,IAAI,eAAe,YAAY,sBAAsB,EAAE,CAAC;YAC9D,2BAA2B,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC;QAChE,CAAC;aAAM,IAAI,eAAe,YAAY,qBAAqB,EAAE,CAAC;YAC7D,2BAA2B,CAAC,eAAe,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;QACzE,CAAC;aAAM,CAAC;YACP,2BAA2B,CAAC,eAAe,CAAC,CAAC;QAC9C,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["import type { Frame } from '../frame';\nimport { BackstackEntry, NavigationType } from '../frame/frame-interfaces';\nimport { View, IOSHelper } from '../core/view';\nimport { PageBase, actionBarHiddenProperty, enableSwipeBackNavigationProperty } from './page-common';\n\nimport { profile } from '../../profiling';\nimport { layout } from '../../utils/layout-helper';\nimport { SDK_VERSION } from '../../utils/constants';\nimport { getLastFocusedViewOnPage } from '../../accessibility/accessibility-common';\nimport { SharedTransition } from '../transition/shared-transition';\nimport { isAccessibilityServiceEnabled } from '../../accessibility';\n\nexport * from './page-common';\n\nconst ENTRY = '_entry';\nconst DELEGATE = '_delegate';\nconst TRANSITION = '_transition';\nconst NON_ANIMATED_TRANSITION = 'non-animated';\n\n@NativeClass\nclass UIViewControllerImpl extends UIViewController {\n\t// TODO: a11y\n\t// static ObjCExposedMethods = {\n\t// \taccessibilityPerformEscape: { returns: interop.types.bool, params: [interop.types.void] },\n\t// };\n\tprivate _owner: WeakRef<Page>;\n\n\tpublic isBackstackSkipped: boolean;\n\tpublic isBackstackCleared: boolean;\n\t// private didFirstLayout: boolean;\n\t// this is initialized in initWithOwner since the constructor doesn't run on native classes\n\t// private _isRunningLayout: number;\n\t// private get isRunningLayout() {\n\t// \treturn this._isRunningLayout !== 0;\n\t// }\n\t// private startRunningLayout() {\n\t// \tthis._isRunningLayout++;\n\t// }\n\t// private finishRunningLayout() {\n\t// \tthis._isRunningLayout--;\n\t// \tthis.clearScheduledLayout();\n\t// }\n\t// private runLayout(cb: () => void) {\n\t// \ttry {\n\t// \t\tthis.startRunningLayout();\n\t// \t\tcb();\n\t// \t} finally {\n\t// \t\tthis.finishRunningLayout();\n\t// \t}\n\t// }\n\n\t// layoutTimer: number;\n\n\t// private clearScheduledLayout() {\n\t// \tif (this.layoutTimer) {\n\t// \t\tclearTimeout(this.layoutTimer);\n\t// \t\tthis.layoutTimer = null;\n\t// \t}\n\t// }\n\n\t// private scheduleLayout() {\n\t// \tif (this.layoutTimer) {\n\t// \t\treturn;\n\t// \t}\n\t// \tsetTimeout(() => {\n\t// \t\tthis.layoutTimer = null;\n\t// \t\tif (!this.isRunningLayout) {\n\t// \t\t\tthis.runLayout(() => this.layoutOwner());\n\t// \t\t}\n\t// \t});\n\t// }\n\n\tpublic static initWithOwner(owner: WeakRef<Page>): UIViewControllerImpl {\n\t\tconst controller = <UIViewControllerImpl>UIViewControllerImpl.new();\n\t\tcontroller._owner = owner;\n\t\t// controller._isRunningLayout = 0;\n\n\t\treturn controller;\n\t}\n\n\tpublic viewDidLoad(): void {\n\t\tsuper.viewDidLoad();\n\n\t\t// Unify translucent and opaque bars layout\n\t\t// this.edgesForExtendedLayout = UIRectEdgeBottom;\n\t\tthis.extendedLayoutIncludesOpaqueBars = true;\n\t}\n\n\tpublic viewWillAppear(animated: boolean): void {\n\t\tsuper.viewWillAppear(animated);\n\t\tconst owner = this._owner?.deref();\n\t\tif (!owner) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst frame: Frame = this.navigationController ? (<any>this.navigationController).owner : null;\n\n\t\tif (frame) {\n\t\t\tconst entry: BackstackEntry = this[ENTRY];\n\t\t\tconst currentPage = frame.currentPage;\n\n\t\t\t// Don't raise event if currentPage was showing modal page.\n\t\t\tif (!owner._presentedViewController && entry && currentPage !== owner && !frame._executingContext) {\n\t\t\t\tconst isBack: boolean = frame.backStack.includes(entry);\n\n\t\t\t\tframe._executingContext = {\n\t\t\t\t\tentry,\n\t\t\t\t\tisBackNavigation: isBack,\n\t\t\t\t\tnavigationType: isBack ? NavigationType.back : NavigationType.forward,\n\t\t\t\t};\n\t\t\t\tframe._onNavigatingTo(entry, isBack);\n\t\t\t}\n\n\t\t\tframe._resolvedPage = owner;\n\n\t\t\tif (owner.parent === frame) {\n\t\t\t\tframe._inheritStyles(owner);\n\t\t\t} else {\n\t\t\t\tif (!owner.parent) {\n\t\t\t\t\tif (!frame._styleScope) {\n\t\t\t\t\t\t// Make sure page will have styleScope even if frame doesn't.\n\t\t\t\t\t\towner._updateStyleScope();\n\t\t\t\t\t}\n\n\t\t\t\t\tframe._addView(owner);\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error('Page is already shown on another frame.');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tframe._updateActionBar(owner);\n\t\t}\n\n\t\t// Set autoAdjustScrollInsets in will appear - as early as possible\n\t\tIOSHelper.updateAutoAdjustScrollInsets(this, owner);\n\n\t\t// Pages in backstack are unloaded so raise loaded here.\n\t\tif (!owner.isLoaded) {\n\t\t\towner.callLoaded();\n\t\t\t// On first appearance, apply status bar style after the page is attached to the frame/nav stack.\n\t\t\towner.updateStatusBar();\n\t\t} else {\n\t\t\t// Note: Handle the case of canceled backstack navigation. (https://github.com/NativeScript/NativeScript/issues/7430)\n\t\t\t// In this case viewWillAppear will be executed for the previous page and it will change the ActionBar\n\t\t\t// because changes happen in an interactive transition - IOS will animate between the the states.\n\t\t\t// If canceled - viewWillAppear will be called for the current page(which is already loaded) and we need to\n\t\t\t// update the action bar explicitly, so that it is not left styles as the previous page.\n\t\t\towner.updateWithWillAppear(animated);\n\t\t}\n\t}\n\n\t@profile\n\tpublic viewDidAppear(animated: boolean): void {\n\t\tsuper.viewDidAppear(animated);\n\n\t\tconst owner = this._owner?.deref();\n\t\tif (!owner) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst navigationController = this.navigationController;\n\t\tconst frame: Frame = navigationController ? (<any>navigationController).owner : null;\n\t\tif (frame) {\n\t\t\tconst newEntry: BackstackEntry = this[ENTRY];\n\n\t\t\t// There are cases like swipe back navigation that can be cancelled.\n\t\t\t// When that's the case, stop here and unset executing context.\n\t\t\tif (frame._executingContext && frame._executingContext.entry !== newEntry) {\n\t\t\t\tframe._executingContext = null;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Skip navigation events if modal page is shown.\n\t\t\tif (!owner._presentedViewController) {\n\t\t\t\t// frame.setCurrent(...) will reset executing context so retrieve it here\n\t\t\t\tconst navigationType = frame._executingContext?.navigationType ?? NavigationType.back;\n\t\t\t\tconst isReplace = navigationType === NavigationType.replace;\n\n\t\t\t\tframe.setCurrent(newEntry, navigationType);\n\n\t\t\t\tif (isReplace) {\n\t\t\t\t\tconst controller = newEntry.resolvedPage.ios;\n\t\t\t\t\tif (controller) {\n\t\t\t\t\t\tconst animated = frame._getIsAnimatedNavigation(newEntry.entry);\n\t\t\t\t\t\tif (animated) {\n\t\t\t\t\t\t\tcontroller[TRANSITION] = frame._getNavigationTransition(newEntry.entry);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcontroller[TRANSITION] = {\n\t\t\t\t\t\t\t\tname: NON_ANIMATED_TRANSITION,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If page was shown with custom animation - we need to set the navigationController.delegate to the animatedDelegate.\n\t\t\t\tif (frame.ios?.controller) {\n\t\t\t\t\tframe.ios.controller.delegate = this[DELEGATE];\n\t\t\t\t}\n\n\t\t\t\tframe._processNavigationQueue(owner);\n\n\t\t\t\tif (!__VISIONOS__) {\n\t\t\t\t\t// _processNavigationQueue will shift navigationQueue. Check canGoBack after that.\n\t\t\t\t\t// Workaround for disabled backswipe on second custom native transition\n\t\t\t\t\tif (frame.canGoBack()) {\n\t\t\t\t\t\tconst transitionState = SharedTransition.getState(owner.transitionId);\n\t\t\t\t\t\tif (transitionState?.interactive) {\n\t\t\t\t\t\t\t// A custom interactive dismiss is wired up (shared transition with\n\t\t\t\t\t\t\t// pan gesture). Disable iOS' built-in edge pan so it can't race the\n\t\t\t\t\t\t\t// custom recognizer and run the standard non-interactive pop.\n\t\t\t\t\t\t\tnavigationController.interactivePopGestureRecognizer.enabled = false;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// only consider when interactive transitions are not enabled\n\t\t\t\t\t\t\tnavigationController.interactivePopGestureRecognizer.delegate = navigationController;\n\t\t\t\t\t\t\tnavigationController.interactivePopGestureRecognizer.enabled = owner.enableSwipeBackNavigation;\n\t\t\t\t\t\t\tif (SDK_VERSION >= 26 && navigationController.interactiveContentPopGestureRecognizer) {\n\t\t\t\t\t\t\t\tnavigationController.interactiveContentPopGestureRecognizer.enabled = owner.enableSwipeBackNavigation;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnavigationController.interactivePopGestureRecognizer.enabled = false;\n\t\t\t\t\t\tif (SDK_VERSION >= 26 && navigationController.interactiveContentPopGestureRecognizer) {\n\t\t\t\t\t\t\tnavigationController.interactiveContentPopGestureRecognizer.enabled = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// TODO: testing without the check. Does not seem necessary and have very bad side effects.\n\t\t// if (!this.presentedViewController) {\n\t\t\t// clear presented viewController here only if no presented controller.\n\t\t\t// this is needed because in iOS9 the order of events could be - willAppear, willDisappear, didAppear.\n\t\t\t// If we clean it when we have viewController then once presented VC is dismissed then\n\t\t\towner._presentedViewController = null;\n\t\t// }\n\t}\n\n\t@profile\n\tpublic viewWillDisappear(animated: boolean): void {\n\t\tsuper.viewWillDisappear(animated);\n\n\t\tconst owner = this._owner?.deref();\n\t\tif (!owner) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Cache presentedViewController if any. We don't want to raise\n\t\t// navigation events in case of presenting view controller.\n\t\t// It is still set when the frame navigates away from a page that has a modal open,\n\t\t// and that navigation must raise its events.\n\t\tconst frame: Frame = this.navigationController ? (<any>this.navigationController).owner : null;\n\t\tconst executingEntry = frame?._executingContext?.entry;\n\t\tconst isNavigatingAway = !!executingEntry && executingEntry !== this[ENTRY];\n\t\tif (!owner._presentedViewController && !isNavigatingAway) {\n\t\t\towner._presentedViewController = this.presentedViewController;\n\t\t}\n\n\t\towner.updateWithWillDisappear(animated);\n\t}\n\n\t@profile\n\tpublic viewDidDisappear(animated: boolean): void {\n\t\tsuper.viewDidDisappear(animated);\n\n\t\tconst owner = this._owner?.deref();\n\n\t\t// Exit if no page or page is hiding because it shows another page modally.\n\t\tif (!owner || owner.modal || owner._presentedViewController) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Forward navigation does not remove page from frame so we raise unloaded manually.\n\t\tif (owner.isLoaded) {\n\t\t\towner.callUnloaded();\n\t\t}\n\t}\n\n\tpublic viewWillLayoutSubviews(): void {\n\t\tsuper.viewWillLayoutSubviews();\n\t\tconst owner = this._owner?.deref();\n\t\tif (owner) {\n\t\t\tIOSHelper.updateConstraints(this, owner);\n\t\t}\n\t}\n\n\tpublic viewSafeAreaInsetsDidChange(): void {\n\t\tsuper.viewSafeAreaInsetsDidChange();\n\t\t// if (this.isRunningLayout || !this.didFirstLayout) {\n\t\t// \treturn;\n\t\t// }\n\t\t// const owner = this._owner?.deref();\n\t\t// if (owner) {\n\t\t// \tthis.runLayout(() => IOSHelper.layoutView(this, owner));\n\t\t// }\n\t}\n\n\tpublic viewDidLayoutSubviews(): void {\n\t\t// this.startRunningLayout();\n\t\tsuper.viewDidLayoutSubviews();\n\t\tconst owner = this._owner?.deref();\n\t\tif (owner) {\n\t\t\t// layout(owner.actionBar)\n\t\t\t// layout(owner.content)\n\n\t\t\tif (SDK_VERSION >= 11) {\n\t\t\t\t// Handle nested Page safe area insets application.\n\t\t\t\t// A Page is nested if its Frame has a parent.\n\t\t\t\t// If the Page is nested, cross check safe area insets on top and bottom with Frame parent.\n\t\t\t\tconst frame = owner.parent;\n\t\t\t\t// There is a legacy scenario where Page is not in a Frame - the root of a Modal View, so it has no parent.\n\t\t\t\tlet frameParent = frame && frame.parent;\n\n\t\t\t\t// Handle Angular scenario where TabView is in a ProxyViewContainer\n\t\t\t\t// It is possible to wrap components in ProxyViewContainers indefinitely\n\t\t\t\t// Not using instanceof ProxyViewContainer to avoid circular dependency\n\t\t\t\t// TODO: Try moving UIViewControllerImpl out of page module\n\t\t\t\twhile (frameParent && !frameParent.nativeViewProtected) {\n\t\t\t\t\tframeParent = frameParent.parent;\n\t\t\t\t}\n\n\t\t\t\tif (frameParent) {\n\t\t\t\t\tconst parentPageInsetsTop = frameParent.nativeViewProtected.safeAreaInsets.top;\n\t\t\t\t\tconst parentPageInsetsBottom = frameParent.nativeViewProtected.safeAreaInsets.bottom;\n\t\t\t\t\tlet currentInsetsTop = this.view.safeAreaInsets.top;\n\t\t\t\t\tlet currentInsetsBottom = this.view.safeAreaInsets.bottom;\n\n\t\t\t\t\t// Safe area insets include additional safe area insets too, so subtract old values\n\t\t\t\t\tif (this.additionalSafeAreaInsets) {\n\t\t\t\t\t\tcurrentInsetsTop -= this.additionalSafeAreaInsets.top;\n\t\t\t\t\t\tcurrentInsetsBottom -= this.additionalSafeAreaInsets.bottom;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst additionalInsetsTop = Math.max(parentPageInsetsTop - currentInsetsTop, 0);\n\t\t\t\t\tconst additionalInsetsBottom = Math.max(parentPageInsetsBottom - currentInsetsBottom, 0);\n\n\t\t\t\t\tif (additionalInsetsTop > 0 || additionalInsetsBottom > 0) {\n\t\t\t\t\t\tconst additionalInsets = new UIEdgeInsets({\n\t\t\t\t\t\t\ttop: additionalInsetsTop,\n\t\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\t\tbottom: additionalInsetsBottom,\n\t\t\t\t\t\t\tright: 0,\n\t\t\t\t\t\t});\n\t\t\t\t\t\tthis.additionalSafeAreaInsets = additionalInsets;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.additionalSafeAreaInsets = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tIOSHelper.layoutView(this, owner);\n\t\t}\n\t\t// this.finishRunningLayout();\n\t}\n\n\t// Mind implementation for other controllerss\n\tpublic traitCollectionDidChange(previousTraitCollection: UITraitCollection): void {\n\t\tsuper.traitCollectionDidChange(previousTraitCollection);\n\n\t\tconst owner = this._owner?.deref();\n\t\tif (owner) {\n\t\t\tif (SDK_VERSION >= 13) {\n\t\t\t\tif (this.traitCollection.hasDifferentColorAppearanceComparedToTraitCollection && this.traitCollection.hasDifferentColorAppearanceComparedToTraitCollection(previousTraitCollection)) {\n\t\t\t\t\towner.notify({\n\t\t\t\t\t\teventName: IOSHelper.traitCollectionColorAppearanceChangedEvent,\n\t\t\t\t\t\tobject: owner,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.traitCollection.layoutDirection !== previousTraitCollection.layoutDirection) {\n\t\t\t\towner.notify({\n\t\t\t\t\teventName: IOSHelper.traitCollectionLayoutDirectionChangedEvent,\n\t\t\t\t\tobject: owner,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic accessibilityPerformEscape() {\n\t\tconst owner = this._owner?.deref();\n\t\tif (owner?.onAccessibilityPerformEscape) {\n\t\t\tconst result = owner.onAccessibilityPerformEscape();\n\t\t\treturn result;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// @ts-ignore\n\tpublic get preferredStatusBarStyle(): UIStatusBarStyle {\n\t\tconst owner = this._owner?.deref();\n\t\tif (owner?.statusBarStyle) {\n\t\t\tif (SDK_VERSION >= 13) {\n\t\t\t\treturn owner.statusBarStyle === 'light' ? UIStatusBarStyle.LightContent : UIStatusBarStyle.DarkContent;\n\t\t\t} else {\n\t\t\t\treturn owner.statusBarStyle === 'light' ? UIStatusBarStyle.LightContent : UIStatusBarStyle.Default;\n\t\t\t}\n\t\t}\n\t\treturn UIStatusBarStyle.Default;\n\t}\n}\n\nexport class Page extends PageBase {\n\tdeclare nativeViewProtected: UIView;\n\tdeclare viewController: UIViewControllerImpl;\n\tonAccessibilityPerformEscape: () => boolean;\n\n\tprivate _backgroundColor = SDK_VERSION <= 12 && !UIColor.systemBackgroundColor ? UIColor.whiteColor : UIColor.systemBackgroundColor;\n\tprivate _ios: UIViewControllerImpl;\n\tpublic _presentedViewController: UIViewController; // used when our page present native viewController without going through our abstraction.\n\n\tconstructor() {\n\t\tsuper();\n\t\tconst controller = UIViewControllerImpl.initWithOwner(new WeakRef(this));\n\t\tcontroller.view.backgroundColor = this._backgroundColor;\n\t\tthis.viewController = this._ios = controller;\n\t}\n\n\tcreateNativeView() {\n\t\t// View controller can be disposed during view disposal, so make sure to create a new one if not defined\n\t\tif (!this._ios) {\n\t\t\tconst controller = UIViewControllerImpl.initWithOwner(new WeakRef(this));\n\t\t\tcontroller.view.backgroundColor = this._backgroundColor;\n\t\t\tthis.viewController = this._ios = controller;\n\t\t}\n\t\treturn this._ios.view;\n\t}\n\n\tdisposeNativeView() {\n\t\tthis.viewController = null;\n\t\tthis._ios = null;\n\t\tsuper.disposeNativeView();\n\t}\n\n\t// @ts-ignore\n\tget ios(): UIViewController {\n\t\treturn this._ios;\n\t}\n\n\tpublic layoutNativeView(left: number, top: number, right: number, bottom: number): void {\n\t\tconst nativeView = this.nativeViewProtected;\n\t\tif (!nativeView) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst currentFrame = nativeView.frame;\n\t\t// Create a copy of current view frame\n\t\tconst newFrame = CGRectMake(currentFrame.origin.x, currentFrame.origin.y, currentFrame.size.width, currentFrame.size.height);\n\n\t\tthis._setNativeViewFrame(nativeView, newFrame);\n\t}\n\n\tpublic _modifyNativeViewFrame(nativeView: UIView, frame: CGRect) {\n\t\t//\n\t}\n\n\tpublic _shouldDelayLayout(): boolean {\n\t\treturn this.frame && this.frame._animationInProgress;\n\t}\n\n\tpublic onLoaded(): void {\n\t\tsuper.onLoaded();\n\t\tif (this.hasActionBar) {\n\t\t\tthis.actionBar.update();\n\t\t}\n\t}\n\tupdateWithWillAppear(animated: boolean) {\n\t\t// this method is important because it allows plugins to react to modal page close\n\t\t// for example allowing updating status bar background color\n\t\tif (this.hasActionBar) {\n\t\t\tthis.actionBar.update();\n\t\t}\n\t\tthis.updateStatusBar();\n\t}\n\n\tupdateWithWillDisappear(animated: boolean) {\n\t\t// this method is important because it allows plugins to react to modal page close\n\t\t// for example allowing updating status bar background color\n\t}\n\n\tpublic updateStatusBar() {\n\t\tthis._updateStatusBarStyle(this.statusBarStyle);\n\t}\n\n\tpublic _updateStatusBarStyle(value?: string) {\n\t\tconst frame = this.frame;\n\t\tif (frame?.ios && value) {\n\t\t\tconst navigationController: UINavigationController = frame.ios.controller;\n\t\t\tIOSHelper.invalidateStatusBarAppearance(navigationController, `Page._updateStatusBarStyle:${value}`);\n\t\t}\n\t}\n\n\tpublic _updateEnableSwipeBackNavigation(enabled: boolean) {\n\t\tconst navController = this._ios.navigationController;\n\t\tif (this.frame && navController) {\n\t\t\t// Make sure we don't set true if cannot go back\n\t\t\tenabled = enabled && this.frame.canGoBack();\n\t\t\tif (navController.interactivePopGestureRecognizer) {\n\t\t\t\tnavController.interactivePopGestureRecognizer.enabled = enabled;\n\t\t\t}\n\n\t\t\tif (SDK_VERSION >= 26 && navController.interactiveContentPopGestureRecognizer) {\n\t\t\t\tnavController.interactiveContentPopGestureRecognizer.enabled = enabled;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic onMeasure(widthMeasureSpec: number, heightMeasureSpec: number) {\n\t\tconst width = layout.getMeasureSpecSize(widthMeasureSpec);\n\t\tconst widthMode = layout.getMeasureSpecMode(widthMeasureSpec);\n\n\t\tconst height = layout.getMeasureSpecSize(heightMeasureSpec);\n\t\tconst heightMode = layout.getMeasureSpecMode(heightMeasureSpec);\n\n\t\tif (this.hasActionBar && this.frame && this.frame._getNavBarVisible(this)) {\n\t\t\tconst { width, height } = this.actionBar._getActualSize;\n\t\t\tconst widthSpec = layout.makeMeasureSpec(width, layout.EXACTLY);\n\t\t\tconst heightSpec = layout.makeMeasureSpec(height, layout.EXACTLY);\n\t\t\tView.measureChild(this, this.actionBar, widthSpec, heightSpec);\n\t\t}\n\n\t\tconst result = View.measureChild(this, this.layoutView, widthMeasureSpec, heightMeasureSpec);\n\n\t\tconst measureWidth = Math.max(result.measuredWidth, this.effectiveMinWidth);\n\t\tconst measureHeight = Math.max(result.measuredHeight, this.effectiveMinHeight);\n\n\t\tconst widthAndState = View.resolveSizeAndState(measureWidth, width, widthMode, 0);\n\t\tconst heightAndState = View.resolveSizeAndState(measureHeight, height, heightMode, 0);\n\n\t\tthis.setMeasuredDimension(widthAndState, heightAndState);\n\t}\n\n\tpublic onLayout(left: number, top: number, right: number, bottom: number) {\n\t\tif (this.hasActionBar) {\n\t\t\tconst { width: actionBarWidth, height: actionBarHeight } = this.actionBar._getActualSize;\n\t\t\tView.layoutChild(this, this.actionBar, 0, 0, actionBarWidth, actionBarHeight);\n\t\t}\n\n\t\tconst insets = this.getSafeAreaInsets();\n\n\t\tif (!__VISIONOS__ && SDK_VERSION <= 10 && this.viewController) {\n\t\t\t// iOS 10 and below don't have safe area insets API,\n\t\t\t// there we need only the top inset on the Page\n\t\t\tinsets.top = layout.round(layout.toDevicePixels(this.viewController.view.safeAreaLayoutGuide.layoutFrame.origin.y));\n\t\t}\n\n\t\tconst childLeft = 0 + insets.left;\n\t\tconst childTop = 0 + insets.top;\n\t\tconst childRight = right - insets.right;\n\t\tconst childBottom = bottom - insets.bottom;\n\n\t\tView.layoutChild(this, this.layoutView, childLeft, childTop, childRight, childBottom);\n\t}\n\n\tpublic _addViewToNativeVisualTree(child: View, atIndex: number): boolean {\n\t\t// ActionBar is handled by the UINavigationController\n\t\tif (this.hasActionBar && child === this.actionBar) {\n\t\t\treturn true;\n\t\t}\n\n\t\tconst nativeParent = this.nativeViewProtected;\n\t\tconst nativeChild = child.nativeViewProtected;\n\n\t\tconst viewController = child.ios instanceof UIViewController ? child.ios : child.viewController;\n\t\tif (viewController) {\n\t\t\t// Adding modal controllers to as child will make app freeze.\n\t\t\tif (this.viewController.presentedViewController === viewController) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tthis.viewController.addChildViewController(viewController);\n\t\t}\n\n\t\tif (nativeParent && nativeChild) {\n\t\t\tIOSHelper.insertNativeSubview(nativeParent, nativeChild, atIndex);\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tpublic _removeViewFromNativeVisualTree(child: View): void {\n\t\t// ActionBar is handled by the UINavigationController\n\t\tif (this.hasActionBar && child === this.actionBar) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst viewController = child.ios instanceof UIViewController ? child.ios : child.viewController;\n\t\tif (viewController) {\n\t\t\tviewController.removeFromParentViewController();\n\t\t}\n\n\t\tsuper._removeViewFromNativeVisualTree(child);\n\t}\n\n\t[actionBarHiddenProperty.setNative](value: boolean) {\n\t\t// Invalidate all inner controller.\n\t\tinvalidateTopmostController(this.viewController);\n\n\t\tconst frame = this.frame;\n\t\tif (frame) {\n\t\t\t// Update nav-bar visibility with disabled animations\n\t\t\tframe._updateActionBar(this, true);\n\t\t}\n\t}\n\n\t[enableSwipeBackNavigationProperty.setNative](value: boolean) {\n\t\tthis._updateEnableSwipeBackNavigation(value);\n\t}\n\n\tpublic accessibilityScreenChanged(refocus = false): void {\n\t\tif (!isAccessibilityServiceEnabled()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (refocus) {\n\t\t\tconst lastFocusedView = getLastFocusedViewOnPage(this);\n\t\t\tif (lastFocusedView) {\n\t\t\t\tconst uiView = lastFocusedView.nativeViewProtected;\n\t\t\t\tif (uiView) {\n\t\t\t\t\tUIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, uiView);\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.actionBarHidden) {\n\t\t\tUIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, this.nativeViewProtected);\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.accessibilityLabel) {\n\t\t\tUIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, this.nativeViewProtected);\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.hasActionBar && (this.actionBar.accessibilityLabel || this.actionBar.title)) {\n\t\t\tUIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, this.actionBar.nativeView);\n\n\t\t\treturn;\n\t\t}\n\n\t\tUIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, this.nativeViewProtected);\n\t}\n}\n\nfunction invalidateTopmostController(controller: UIViewController): void {\n\tif (!controller) {\n\t\treturn;\n\t}\n\n\tcontroller.view.setNeedsLayout();\n\n\tconst presentedViewController = controller.presentedViewController;\n\tif (presentedViewController) {\n\t\treturn invalidateTopmostController(presentedViewController);\n\t}\n\n\tconst childControllers = controller.childViewControllers;\n\tlet size = controller.childViewControllers.count;\n\twhile (size > 0) {\n\t\tconst childController = childControllers[--size];\n\t\tif (childController instanceof UITabBarController) {\n\t\t\tinvalidateTopmostController(childController.selectedViewController);\n\t\t} else if (childController instanceof UINavigationController) {\n\t\t\tinvalidateTopmostController(childController.topViewController);\n\t\t} else if (childController instanceof UISplitViewController) {\n\t\t\tinvalidateTopmostController(childController.viewControllers.lastObject);\n\t\t} else {\n\t\t\tinvalidateTopmostController(childController);\n\t\t}\n\t}\n}\n"]}
@@ -18,7 +18,7 @@ function initializeNativeClasses() {
18
18
  function CompatQueryTextListenerImpl(owner) {
19
19
  var _this = _super.call(this) || this;
20
20
  _this.owner = owner;
21
- return global.__native(_this);
21
+ return _this;
22
22
  }
23
23
  CompatQueryTextListenerImpl.prototype.onQueryTextChange = function (newText) {
24
24
  var owner = this.owner;
@@ -48,7 +48,7 @@ function initializeNativeClasses() {
48
48
  function CompatCloseListenerImpl(owner) {
49
49
  var _this = _super.call(this) || this;
50
50
  _this.owner = owner;
51
- return global.__native(_this);
51
+ return _this;
52
52
  }
53
53
  CompatCloseListenerImpl.prototype.onClose = function () {
54
54
  this.owner._emit(SearchBarBase.clearEvent);
@@ -1 +1 @@
1
- {"version":3,"file":"index.android.js","sourceRoot":"","sources":["../../../../../packages/core/ui/search-bar/index.android.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,0BAA0B,EAAE,gCAAgC,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AACxK,OAAO,EAAE,gCAAgC,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACnF,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAGzJ,cAAc,qBAAqB,CAAC;AAEpC,MAAM,UAAU,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;AACxC,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;AAU9B,IAAI,iBAAoC,CAAC;AACzC,IAAI,aAA4B,CAAC;AAEjC,SAAS,uBAAuB;IAC/B,IAAI,iBAAiB,EAAE,CAAC;QACvB,OAAO;IACR,CAAC;;;;;;;QAxBY,CAAC;;;;;;YAQU,CAAC;;;;QAGqC,CAAC;;;;;YAgBxD,CAAC;;;QAA2D,CAAC;;;;;I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C,cAAc,EAAE,CAAC;YACvE,MAAM,EAAE,GAAG,IAAI,CAAC,mBAAmB,CAAC,UAAU,EAAE,CAAC,YAAY,EAAE,CAAC,aAAa,CAAC,iBAAiB,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;YAChH,IAAI,CAAC,eAAe,GAA4B,IAAI,CAAC,mBAAmB,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QAC3F,CAAC;QAED,OAAO,IAAI,CAAC,eAAe,CAAC;IAC7B,CAAC;IAEO,eAAe;QACtB,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YACxB,MAAM,OAAO,GAAG,IAAI,CAAC,mBAAmB,CAAC,UAAU,EAAE,CAAC,cAAc,EAAE,CAAC;YACvE,MAAM,EAAE,GAAG,IAAI,CAAC,mBAAmB,CAAC,UAAU,EAAE,CAAC,YAAY,EAAE,CAAC,aAAa,CAAC,cAAc,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;YAC7G,IAAI,CAAC,YAAY,GAAgC,IAAI,CAAC,mBAAmB,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QAC5F,CAAC;QAED,OAAO,IAAI,CAAC,YAAY,CAAC;IAC1B,CAAC;CACD","sourcesContent":["import { Font } from '../styling/font';\nimport { SearchBarBase, textProperty, hintProperty, textFieldHintColorProperty, textFieldBackgroundColorProperty, clearButtonColorProperty } from './search-bar-common';\nimport { isUserInteractionEnabledProperty, isEnabledProperty } from '../core/view';\nimport { ad } from '../../utils';\nimport { Color } from '../../color';\nimport { colorProperty, backgroundColorProperty, backgroundInternalProperty, fontInternalProperty, fontSizeProperty } from '../styling/style-properties';\nimport { Background } from '../styling/background';\n\nexport * from './search-bar-common';\n\nconst SEARCHTEXT = Symbol('searchText');\nconst QUERY = Symbol('query');\n\ninterface QueryTextListener {\n\tnew (owner: SearchBar): androidx.appcompat.widget.SearchView.OnQueryTextListener;\n}\n\ninterface CloseListener {\n\tnew (owner: SearchBar): androidx.appcompat.widget.SearchView.OnCloseListener;\n}\n\nlet QueryTextListener: QueryTextListener;\nlet CloseListener: CloseListener;\n\nfunction initializeNativeClasses(): void {\n\tif (QueryTextListener) {\n\t\treturn;\n\t}\n\n\t@NativeClass\n\t@Interfaces([androidx.appcompat.widget.SearchView.OnQueryTextListener])\n\tclass CompatQueryTextListenerImpl extends java.lang.Object implements androidx.appcompat.widget.SearchView.OnQueryTextListener {\n\t\tconstructor(private owner: SearchBar) {\n\t\t\tsuper();\n\n\t\t\t// @ts-ignore\n\t\t\treturn global.__native(this);\n\t\t}\n\n\t\tonQueryTextChange(newText: string): boolean {\n\t\t\tconst owner = this.owner;\n\t\t\ttextProperty.nativeValueChange(owner, newText);\n\n\t\t\t// This code is needed since sometimes OnCloseListener is not called!\n\t\t\tif (newText === '' && this[SEARCHTEXT] !== newText) {\n\t\t\t\towner._emit(SearchBarBase.clearEvent);\n\t\t\t}\n\n\t\t\tthis[SEARCHTEXT] = newText;\n\t\t\tthis[QUERY] = undefined;\n\n\t\t\treturn true;\n\t\t}\n\n\t\tonQueryTextSubmit(query: string): boolean {\n\t\t\tconst owner = this.owner;\n\t\t\t// This code is needed since onQueryTextSubmit is called twice with same query!\n\t\t\tif (query !== '' && this[QUERY] !== query) {\n\t\t\t\towner._emit(SearchBarBase.submitEvent);\n\t\t\t}\n\n\t\t\tthis[QUERY] = query;\n\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t@NativeClass\n\t@Interfaces([androidx.appcompat.widget.SearchView.OnCloseListener])\n\tclass CompatCloseListenerImpl extends java.lang.Object implements androidx.appcompat.widget.SearchView.OnCloseListener {\n\t\tconstructor(private owner: SearchBar) {\n\t\t\tsuper();\n\n\t\t\t// @ts-ignore\n\t\t\treturn global.__native(this);\n\t\t}\n\n\t\tonClose(): boolean {\n\t\t\tthis.owner._emit(SearchBarBase.clearEvent);\n\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tQueryTextListener = CompatQueryTextListenerImpl;\n\tCloseListener = CompatCloseListenerImpl;\n}\n\nfunction enableSearchView(nativeView: any, value: boolean) {\n\tnativeView.setEnabled(value);\n\n\tif (!(nativeView instanceof android.view.ViewGroup)) {\n\t\treturn;\n\t}\n\n\tfor (let i = 0; i < nativeView.getChildCount(); i++) {\n\t\tconst child = nativeView.getChildAt(i);\n\t\tenableSearchView(child, value);\n\t}\n}\n\nfunction enableUserInteractionSearchView(nativeView: any, value: boolean) {\n\tnativeView.setClickable(value);\n\tnativeView.setFocusable(value);\n\n\tif (!(nativeView instanceof android.view.ViewGroup)) {\n\t\treturn;\n\t}\n\n\tfor (let i = 0; i < nativeView.getChildCount(); i++) {\n\t\tconst child = nativeView.getChildAt(i);\n\t\tenableUserInteractionSearchView(child, value);\n\t}\n}\n\nexport class SearchBar extends SearchBarBase {\n\tdeclare nativeViewProtected: androidx.appcompat.widget.SearchView;\n\tprivate _searchTextView: android.widget.TextView;\n\tprivate _searchPlate: android.widget.LinearLayout;\n\n\tpublic dismissSoftInput() {\n\t\tad.dismissSoftInput(this.nativeViewProtected);\n\t}\n\n\tpublic focus(): boolean {\n\t\tconst result = super.focus();\n\n\t\tif (result) {\n\t\t\tif (this.nativeViewProtected) {\n\t\t\t\t// Android search view is a view consisted of multiple views, so get the focused view\n\t\t\t\tconst focusedNativeView = this.nativeViewProtected.findFocus();\n\t\t\t\tif (focusedNativeView) {\n\t\t\t\t\tad.showSoftInput(focusedNativeView);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tpublic createNativeView() {\n\t\tconst nativeView = new androidx.appcompat.widget.SearchView(this._context);\n\t\tnativeView.setIconified(false);\n\n\t\treturn nativeView;\n\t}\n\n\tpublic initNativeView(): void {\n\t\tsuper.initNativeView();\n\t\tconst nativeView = this.nativeViewProtected;\n\t\tinitializeNativeClasses();\n\t\tconst queryTextListener = new QueryTextListener(this);\n\t\tnativeView.setOnQueryTextListener(queryTextListener);\n\t\t(<any>nativeView).queryTextListener = queryTextListener;\n\n\t\tconst closeListener = new CloseListener(this);\n\t\tnativeView.setOnCloseListener(closeListener);\n\t\t(<any>nativeView).closeListener = closeListener;\n\t}\n\n\tpublic disposeNativeView() {\n\t\tconst nativeView: any = this.nativeViewProtected;\n\t\tif (nativeView.closeListener) {\n\t\t\tnativeView.closeListener.owner = null;\n\t\t}\n\t\tif (nativeView.queryTextListener) {\n\t\t\tnativeView.queryTextListener.owner = null;\n\t\t}\n\t\tthis._searchPlate = null;\n\t\tthis._searchTextView = null;\n\t\tsuper.disposeNativeView();\n\t}\n\n\t[isEnabledProperty.setNative](value: boolean) {\n\t\tenableSearchView(this.nativeViewProtected, value);\n\t}\n\n\t[isUserInteractionEnabledProperty.setNative](value: boolean) {\n\t\tenableUserInteractionSearchView(this.nativeViewProtected, value);\n\t}\n\n\t[backgroundColorProperty.getDefault](): number {\n\t\t// TODO: Why do we get DrawingCacheBackgroundColor but set backgroundColor?????\n\t\tconst result = this.nativeViewProtected.getDrawingCacheBackgroundColor();\n\n\t\treturn result;\n\t}\n\t[backgroundColorProperty.setNative](value: Color) {\n\t\tlet color: number;\n\t\tif (typeof value === 'number') {\n\t\t\tcolor = value;\n\t\t} else {\n\t\t\tcolor = value.android;\n\t\t}\n\n\t\tthis.nativeViewProtected.setBackgroundColor(color);\n\t\tconst searchPlate = this._getSearchPlate();\n\t\tsearchPlate.setBackgroundColor(color);\n\t}\n\n\t[colorProperty.getDefault](): number {\n\t\tconst textView = this._getTextView();\n\n\t\treturn textView.getCurrentTextColor();\n\t}\n\t[colorProperty.setNative](value: Color) {\n\t\tconst color: number = typeof value === 'number' ? value : value.android;\n\t\tconst textView = this._getTextView();\n\t\ttextView.setTextColor(color);\n\t}\n\n\t[fontSizeProperty.getDefault](): { nativeSize: number } {\n\t\treturn { nativeSize: this._getTextView().getTextSize() };\n\t}\n\t[fontSizeProperty.setNative](value: number | { nativeSize: number }) {\n\t\tif (typeof value === 'number') {\n\t\t\tthis._getTextView().setTextSize(value);\n\t\t} else {\n\t\t\tthis._getTextView().setTextSize(android.util.TypedValue.COMPLEX_UNIT_PX, value.nativeSize);\n\t\t}\n\t}\n\n\t[fontInternalProperty.getDefault](): android.graphics.Typeface {\n\t\treturn this._getTextView().getTypeface();\n\t}\n\t[fontInternalProperty.setNative](value: Font | android.graphics.Typeface) {\n\t\tthis._getTextView().setTypeface(value instanceof Font ? value.getAndroidTypeface() : value);\n\t}\n\n\t[backgroundInternalProperty.getDefault](): any {\n\t\treturn null;\n\t}\n\t[backgroundInternalProperty.setNative](value: android.graphics.drawable.Drawable | Background) {\n\t\t//\n\t}\n\n\t[textProperty.getDefault](): string {\n\t\treturn '';\n\t}\n\t[textProperty.setNative](value: string) {\n\t\tconst text = value === null || value === undefined ? '' : value.toString();\n\t\tthis.nativeViewProtected.setQuery(text, false);\n\t}\n\t[hintProperty.getDefault](): string {\n\t\treturn null;\n\t}\n\t[hintProperty.setNative](value: string) {\n\t\tif (value === null || value === undefined) {\n\t\t\tthis.nativeViewProtected.setQueryHint(null);\n\t\t} else {\n\t\t\tthis.nativeViewProtected.setQueryHint(value.toString());\n\t\t}\n\t}\n\t[textFieldBackgroundColorProperty.getDefault](): android.graphics.drawable.Drawable {\n\t\tconst textView = this._getTextView();\n\n\t\treturn textView.getBackground();\n\t}\n\t[textFieldBackgroundColorProperty.setNative](value: Color) {\n\t\tconst textView = this._getTextView();\n\t\tif (value instanceof Color) {\n\t\t\ttextView.setBackgroundColor(value.android);\n\t\t} else {\n\t\t\ttextView.setBackground(value);\n\t\t}\n\t}\n\t[textFieldHintColorProperty.getDefault](): number {\n\t\tconst textView = this._getTextView();\n\n\t\treturn textView.getCurrentTextColor();\n\t}\n\t[textFieldHintColorProperty.setNative](value: Color) {\n\t\tconst textView = this._getTextView();\n\t\tconst color = value instanceof Color ? value.android : value;\n\t\ttextView.setHintTextColor(color);\n\t}\n\t[clearButtonColorProperty.setNative](value: Color) {\n\t\tif (!this.nativeViewProtected || !value) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\t// The close (clear) button inside the SearchView can be found by its resource ID\n\t\t\tconst closeButtonId = this.nativeViewProtected.getContext().getResources().getIdentifier('android:id/search_close_btn', null, null);\n\t\t\tconst closeButton = this.nativeViewProtected.findViewById(closeButtonId) as android.widget.ImageView;\n\n\t\t\tconst color = value instanceof Color ? value.android : new Color(value).android;\n\n\t\t\tif (closeButton) {\n\t\t\t\tcloseButton.setColorFilter(color);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tconsole.log('Error setting clear button color:', err);\n\t\t}\n\t}\n\n\tprivate _getTextView(): android.widget.TextView {\n\t\tif (!this._searchTextView) {\n\t\t\tconst pkgName = this.nativeViewProtected.getContext().getPackageName();\n\t\t\tconst id = this.nativeViewProtected.getContext().getResources().getIdentifier('search_src_text', 'id', pkgName);\n\t\t\tthis._searchTextView = <android.widget.TextView>this.nativeViewProtected.findViewById(id);\n\t\t}\n\n\t\treturn this._searchTextView;\n\t}\n\n\tprivate _getSearchPlate(): android.widget.LinearLayout {\n\t\tif (!this._searchPlate) {\n\t\t\tconst pkgName = this.nativeViewProtected.getContext().getPackageName();\n\t\t\tconst id = this.nativeViewProtected.getContext().getResources().getIdentifier('search_plate', 'id', pkgName);\n\t\t\tthis._searchPlate = <android.widget.LinearLayout>this.nativeViewProtected.findViewById(id);\n\t\t}\n\n\t\treturn this._searchPlate;\n\t}\n}\n"]}
1
+ {"version":3,"file":"index.android.js","sourceRoot":"","sources":["../../../../../packages/core/ui/search-bar/index.android.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,0BAA0B,EAAE,gCAAgC,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AACxK,OAAO,EAAE,gCAAgC,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACnF,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,KAAK,EAA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CAAC;CACD","sourcesContent":["import { Font } from '../styling/font';\nimport { SearchBarBase, textProperty, hintProperty, textFieldHintColorProperty, textFieldBackgroundColorProperty, clearButtonColorProperty } from './search-bar-common';\nimport { isUserInteractionEnabledProperty, isEnabledProperty } from '../core/view';\nimport { ad } from '../../utils';\nimport { Color } from '../../color';\nimport { colorProperty, backgroundColorProperty, backgroundInternalProperty, fontInternalProperty, fontSizeProperty } from '../styling/style-properties';\nimport { Background } from '../styling/background';\n\nexport * from './search-bar-common';\n\nconst SEARCHTEXT = Symbol('searchText');\nconst QUERY = Symbol('query');\n\ninterface QueryTextListener {\n\tnew (owner: SearchBar): androidx.appcompat.widget.SearchView.OnQueryTextListener;\n}\n\ninterface CloseListener {\n\tnew (owner: SearchBar): androidx.appcompat.widget.SearchView.OnCloseListener;\n}\n\nlet QueryTextListener: QueryTextListener;\nlet CloseListener: CloseListener;\n\nfunction initializeNativeClasses(): void {\n\tif (QueryTextListener) {\n\t\treturn;\n\t}\n\n\t@NativeClass\n\t@Interfaces([androidx.appcompat.widget.SearchView.OnQueryTextListener])\n\tclass CompatQueryTextListenerImpl extends java.lang.Object implements androidx.appcompat.widget.SearchView.OnQueryTextListener {\n\t\tconstructor(private owner: SearchBar) {\n\t\t\tsuper();\n\t\t}\n\n\t\tonQueryTextChange(newText: string): boolean {\n\t\t\tconst owner = this.owner;\n\t\t\ttextProperty.nativeValueChange(owner, newText);\n\n\t\t\t// This code is needed since sometimes OnCloseListener is not called!\n\t\t\tif (newText === '' && this[SEARCHTEXT] !== newText) {\n\t\t\t\towner._emit(SearchBarBase.clearEvent);\n\t\t\t}\n\n\t\t\tthis[SEARCHTEXT] = newText;\n\t\t\tthis[QUERY] = undefined;\n\n\t\t\treturn true;\n\t\t}\n\n\t\tonQueryTextSubmit(query: string): boolean {\n\t\t\tconst owner = this.owner;\n\t\t\t// This code is needed since onQueryTextSubmit is called twice with same query!\n\t\t\tif (query !== '' && this[QUERY] !== query) {\n\t\t\t\towner._emit(SearchBarBase.submitEvent);\n\t\t\t}\n\n\t\t\tthis[QUERY] = query;\n\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t@NativeClass\n\t@Interfaces([androidx.appcompat.widget.SearchView.OnCloseListener])\n\tclass CompatCloseListenerImpl extends java.lang.Object implements androidx.appcompat.widget.SearchView.OnCloseListener {\n\t\tconstructor(private owner: SearchBar) {\n\t\t\tsuper();\n\t\t}\n\n\t\tonClose(): boolean {\n\t\t\tthis.owner._emit(SearchBarBase.clearEvent);\n\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tQueryTextListener = CompatQueryTextListenerImpl;\n\tCloseListener = CompatCloseListenerImpl;\n}\n\nfunction enableSearchView(nativeView: any, value: boolean) {\n\tnativeView.setEnabled(value);\n\n\tif (!(nativeView instanceof android.view.ViewGroup)) {\n\t\treturn;\n\t}\n\n\tfor (let i = 0; i < nativeView.getChildCount(); i++) {\n\t\tconst child = nativeView.getChildAt(i);\n\t\tenableSearchView(child, value);\n\t}\n}\n\nfunction enableUserInteractionSearchView(nativeView: any, value: boolean) {\n\tnativeView.setClickable(value);\n\tnativeView.setFocusable(value);\n\n\tif (!(nativeView instanceof android.view.ViewGroup)) {\n\t\treturn;\n\t}\n\n\tfor (let i = 0; i < nativeView.getChildCount(); i++) {\n\t\tconst child = nativeView.getChildAt(i);\n\t\tenableUserInteractionSearchView(child, value);\n\t}\n}\n\nexport class SearchBar extends SearchBarBase {\n\tdeclare nativeViewProtected: androidx.appcompat.widget.SearchView;\n\tprivate _searchTextView: android.widget.TextView;\n\tprivate _searchPlate: android.widget.LinearLayout;\n\n\tpublic dismissSoftInput() {\n\t\tad.dismissSoftInput(this.nativeViewProtected);\n\t}\n\n\tpublic focus(): boolean {\n\t\tconst result = super.focus();\n\n\t\tif (result) {\n\t\t\tif (this.nativeViewProtected) {\n\t\t\t\t// Android search view is a view consisted of multiple views, so get the focused view\n\t\t\t\tconst focusedNativeView = this.nativeViewProtected.findFocus();\n\t\t\t\tif (focusedNativeView) {\n\t\t\t\t\tad.showSoftInput(focusedNativeView);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tpublic createNativeView() {\n\t\tconst nativeView = new androidx.appcompat.widget.SearchView(this._context);\n\t\tnativeView.setIconified(false);\n\n\t\treturn nativeView;\n\t}\n\n\tpublic initNativeView(): void {\n\t\tsuper.initNativeView();\n\t\tconst nativeView = this.nativeViewProtected;\n\t\tinitializeNativeClasses();\n\t\tconst queryTextListener = new QueryTextListener(this);\n\t\tnativeView.setOnQueryTextListener(queryTextListener);\n\t\t(<any>nativeView).queryTextListener = queryTextListener;\n\n\t\tconst closeListener = new CloseListener(this);\n\t\tnativeView.setOnCloseListener(closeListener);\n\t\t(<any>nativeView).closeListener = closeListener;\n\t}\n\n\tpublic disposeNativeView() {\n\t\tconst nativeView: any = this.nativeViewProtected;\n\t\tif (nativeView.closeListener) {\n\t\t\tnativeView.closeListener.owner = null;\n\t\t}\n\t\tif (nativeView.queryTextListener) {\n\t\t\tnativeView.queryTextListener.owner = null;\n\t\t}\n\t\tthis._searchPlate = null;\n\t\tthis._searchTextView = null;\n\t\tsuper.disposeNativeView();\n\t}\n\n\t[isEnabledProperty.setNative](value: boolean) {\n\t\tenableSearchView(this.nativeViewProtected, value);\n\t}\n\n\t[isUserInteractionEnabledProperty.setNative](value: boolean) {\n\t\tenableUserInteractionSearchView(this.nativeViewProtected, value);\n\t}\n\n\t[backgroundColorProperty.getDefault](): number {\n\t\t// TODO: Why do we get DrawingCacheBackgroundColor but set backgroundColor?????\n\t\tconst result = this.nativeViewProtected.getDrawingCacheBackgroundColor();\n\n\t\treturn result;\n\t}\n\t[backgroundColorProperty.setNative](value: Color) {\n\t\tlet color: number;\n\t\tif (typeof value === 'number') {\n\t\t\tcolor = value;\n\t\t} else {\n\t\t\tcolor = value.android;\n\t\t}\n\n\t\tthis.nativeViewProtected.setBackgroundColor(color);\n\t\tconst searchPlate = this._getSearchPlate();\n\t\tsearchPlate.setBackgroundColor(color);\n\t}\n\n\t[colorProperty.getDefault](): number {\n\t\tconst textView = this._getTextView();\n\n\t\treturn textView.getCurrentTextColor();\n\t}\n\t[colorProperty.setNative](value: Color) {\n\t\tconst color: number = typeof value === 'number' ? value : value.android;\n\t\tconst textView = this._getTextView();\n\t\ttextView.setTextColor(color);\n\t}\n\n\t[fontSizeProperty.getDefault](): { nativeSize: number } {\n\t\treturn { nativeSize: this._getTextView().getTextSize() };\n\t}\n\t[fontSizeProperty.setNative](value: number | { nativeSize: number }) {\n\t\tif (typeof value === 'number') {\n\t\t\tthis._getTextView().setTextSize(value);\n\t\t} else {\n\t\t\tthis._getTextView().setTextSize(android.util.TypedValue.COMPLEX_UNIT_PX, value.nativeSize);\n\t\t}\n\t}\n\n\t[fontInternalProperty.getDefault](): android.graphics.Typeface {\n\t\treturn this._getTextView().getTypeface();\n\t}\n\t[fontInternalProperty.setNative](value: Font | android.graphics.Typeface) {\n\t\tthis._getTextView().setTypeface(value instanceof Font ? value.getAndroidTypeface() : value);\n\t}\n\n\t[backgroundInternalProperty.getDefault](): any {\n\t\treturn null;\n\t}\n\t[backgroundInternalProperty.setNative](value: android.graphics.drawable.Drawable | Background) {\n\t\t//\n\t}\n\n\t[textProperty.getDefault](): string {\n\t\treturn '';\n\t}\n\t[textProperty.setNative](value: string) {\n\t\tconst text = value === null || value === undefined ? '' : value.toString();\n\t\tthis.nativeViewProtected.setQuery(text, false);\n\t}\n\t[hintProperty.getDefault](): string {\n\t\treturn null;\n\t}\n\t[hintProperty.setNative](value: string) {\n\t\tif (value === null || value === undefined) {\n\t\t\tthis.nativeViewProtected.setQueryHint(null);\n\t\t} else {\n\t\t\tthis.nativeViewProtected.setQueryHint(value.toString());\n\t\t}\n\t}\n\t[textFieldBackgroundColorProperty.getDefault](): android.graphics.drawable.Drawable {\n\t\tconst textView = this._getTextView();\n\n\t\treturn textView.getBackground();\n\t}\n\t[textFieldBackgroundColorProperty.setNative](value: Color) {\n\t\tconst textView = this._getTextView();\n\t\tif (value instanceof Color) {\n\t\t\ttextView.setBackgroundColor(value.android);\n\t\t} else {\n\t\t\ttextView.setBackground(value);\n\t\t}\n\t}\n\t[textFieldHintColorProperty.getDefault](): number {\n\t\tconst textView = this._getTextView();\n\n\t\treturn textView.getCurrentTextColor();\n\t}\n\t[textFieldHintColorProperty.setNative](value: Color) {\n\t\tconst textView = this._getTextView();\n\t\tconst color = value instanceof Color ? value.android : value;\n\t\ttextView.setHintTextColor(color);\n\t}\n\t[clearButtonColorProperty.setNative](value: Color) {\n\t\tif (!this.nativeViewProtected || !value) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\t// The close (clear) button inside the SearchView can be found by its resource ID\n\t\t\tconst closeButtonId = this.nativeViewProtected.getContext().getResources().getIdentifier('android:id/search_close_btn', null, null);\n\t\t\tconst closeButton = this.nativeViewProtected.findViewById(closeButtonId) as android.widget.ImageView;\n\n\t\t\tconst color = value instanceof Color ? value.android : new Color(value).android;\n\n\t\t\tif (closeButton) {\n\t\t\t\tcloseButton.setColorFilter(color);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tconsole.log('Error setting clear button color:', err);\n\t\t}\n\t}\n\n\tprivate _getTextView(): android.widget.TextView {\n\t\tif (!this._searchTextView) {\n\t\t\tconst pkgName = this.nativeViewProtected.getContext().getPackageName();\n\t\t\tconst id = this.nativeViewProtected.getContext().getResources().getIdentifier('search_src_text', 'id', pkgName);\n\t\t\tthis._searchTextView = <android.widget.TextView>this.nativeViewProtected.findViewById(id);\n\t\t}\n\n\t\treturn this._searchTextView;\n\t}\n\n\tprivate _getSearchPlate(): android.widget.LinearLayout {\n\t\tif (!this._searchPlate) {\n\t\t\tconst pkgName = this.nativeViewProtected.getContext().getPackageName();\n\t\t\tconst id = this.nativeViewProtected.getContext().getResources().getIdentifier('search_plate', 'id', pkgName);\n\t\t\tthis._searchPlate = <android.widget.LinearLayout>this.nativeViewProtected.findViewById(id);\n\t\t}\n\n\t\treturn this._searchPlate;\n\t}\n}\n"]}
@@ -3,7 +3,7 @@ import { SegmentedBarItemBase, SegmentedBarBase, selectedIndexProperty, itemsPro
3
3
  import { AndroidHelper, isEnabledProperty } from '../core/view';
4
4
  import { colorProperty, fontInternalProperty, fontSizeProperty } from '../styling/style-properties';
5
5
  import { Color } from '../../color';
6
- import { layout } from '../../utils';
6
+ import { android as androidUtils, layout } from '../../utils';
7
7
  import { SDK_VERSION } from '../../utils/constants';
8
8
  import { VIEW_GONE } from '../core/view/index.android';
9
9
  import { Trace } from '../../trace';
@@ -29,7 +29,7 @@ function initializeNativeClasses() {
29
29
  function TabChangeListenerImpl(owner) {
30
30
  var _this = _super.call(this) || this;
31
31
  _this.owner = owner;
32
- return global.__native(_this);
32
+ return _this;
33
33
  }
34
34
  TabChangeListenerImpl.prototype.onTabChanged = function (id) {
35
35
  var owner = this.owner;
@@ -51,12 +51,13 @@ function initializeNativeClasses() {
51
51
  __extends(TabContentFactoryImpl, _super);
52
52
  function TabContentFactoryImpl(owner) {
53
53
  var _this = _super.call(this) || this;
54
- _this.owner = owner;
55
- return global.__native(_this);
54
+ _this.owner = new WeakRef(owner);
55
+ return _this;
56
56
  }
57
57
  TabContentFactoryImpl.prototype.createTabContent = function (tag) {
58
- var tv = new android.widget.TextView(this.owner._context);
59
- var isRtl = this.owner.direction === CoreTypes.LayoutDirection.rtl;
58
+ var owner = this.owner.deref();
59
+ var tv = new android.widget.TextView(owner ? owner._context : androidUtils.getApplicationContext());
60
+ var isRtl = (owner === null || owner === void 0 ? void 0 : owner.direction) === CoreTypes.LayoutDirection.rtl;
60
61
  tv.setVisibility(VIEW_GONE);
61
62
  tv.setMaxLines(1);
62
63
  tv.setEllipsize(isRtl ? android.text.TextUtils.TruncateAt.START : android.text.TextUtils.TruncateAt.END);
@@ -70,8 +71,7 @@ function initializeNativeClasses() {
70
71
  var TabHostImpl = (function (_super) {
71
72
  __extends(TabHostImpl, _super);
72
73
  function TabHostImpl(context, attrs) {
73
- var _this = _super.call(this, context, attrs) || this;
74
- return global.__native(_this);
74
+ return _super.call(this, context, attrs) || this;
75
75
  }
76
76
  TabHostImpl.prototype.onAttachedToWindow = function () {
77
77
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.android.js","sourceRoot":"","sources":["../../../../../packages/core/ui/segmented-bar/index.android.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,aAAa,EAAE,+BAA+B,EAA6B,MAAM,wBAAwB,CAAC;AAClL,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpG,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,cAAc,wBAAwB,CAAC;AAEvC,MAAM,SAAS,GAAG,UAAU,CAAC;AAC7B,MAAM,eAAe,GAAG,UAAU,CAAC;AACnC,MAAM,qBAAqB,GAAG,UAAU,CAAC;AACzC,MAAM,kBAAkB,GAAG,QAAQ,CAAC,CAAC,iEAAiE;AActG,IAAI,0BAAkC,CAAC;AAEvC,IAAI,OAAgB,CAAC;AACrB,IAAI,iBAAoC,CAAC;AACzC,IAAI,iBAAoC,CAAC;AAEzC,gEAAgE;AAChE,SAAS,uBAAuB;IAC/B,IAAI,iBAAiB,EAAE,CAAC;QACvB,OAAO;IACR,CAAC;IAED,oEAAoE;IACpE,0BAA0B,GAAG,MAAM,C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,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC/B,OAAO,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;QACjC,CAAC;aAAM,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;YACnC,OAAO,KAAK,CAAC,OAAO,CAAC;QACtB,CAAC;IACF,CAAC;CACD","sourcesContent":["import { Font } from '../styling/font';\nimport { SegmentedBarItemBase, SegmentedBarBase, selectedIndexProperty, itemsProperty, selectedBackgroundColorProperty, selectedTextColorProperty } from './segmented-bar-common';\nimport { AndroidHelper, isEnabledProperty } from '../core/view';\nimport { colorProperty, fontInternalProperty, fontSizeProperty } from '../styling/style-properties';\nimport { Color } from '../../color';\nimport { layout } from '../../utils';\nimport { SDK_VERSION } from '../../utils/constants';\nimport { VIEW_GONE } from '../core/view/index.android';\nimport { Trace } from '../../trace';\nimport { CoreTypes } from '../../core-types';\n\nexport * from './segmented-bar-common';\n\nconst R_ID_TABS = 0x01020013;\nconst R_ID_TABCONTENT = 0x01020011;\nconst R_ATTR_STATE_SELECTED = 0x010100a1;\nconst TITLE_TEXT_VIEW_ID = 16908310; // http://developer.android.com/reference/android/R.id.html#title\n\ninterface TabChangeListener {\n\tnew (owner: SegmentedBar): android.widget.TabHost.OnTabChangeListener;\n}\n\ninterface TabContentFactory {\n\tnew (owner: SegmentedBar): android.widget.TabHost.TabContentFactory;\n}\n\ninterface TabHost {\n\tnew (context: android.content.Context, attrs: android.util.AttributeSet): android.widget.TabHost;\n}\n\nlet selectedIndicatorThickness: number;\n\nlet TabHost: TabHost;\nlet TabChangeListener: TabChangeListener;\nlet TabContentFactory: TabContentFactory;\n\n// TODO: All TabHost public methods become deprecated in API 30.\nfunction initializeNativeClasses(): void {\n\tif (TabChangeListener) {\n\t\treturn;\n\t}\n\n\t// Indicator thickness for material - 2dip. For pre-material - 5dip.\n\tselectedIndicatorThickness = layout.toDevicePixels(SDK_VERSION >= 21 ? 2 : 5);\n\n\t@NativeClass\n\t@Interfaces([android.widget.TabHost.OnTabChangeListener])\n\tclass TabChangeListenerImpl extends java.lang.Object implements android.widget.TabHost.OnTabChangeListener {\n\t\tconstructor(public owner: SegmentedBar) {\n\t\t\tsuper();\n\n\t\t\treturn global.__native(this);\n\t\t}\n\n\t\tonTabChanged(id: string): void {\n\t\t\tconst owner = this.owner;\n\t\t\tif (owner) {\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\towner.setTabColor(id);\n\t\t\t\t});\n\t\t\t\tif (owner.shouldChangeSelectedIndex()) {\n\t\t\t\t\towner.selectedIndex = parseInt(id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t@NativeClass\n\t@Interfaces([android.widget.TabHost.TabContentFactory])\n\tclass TabContentFactoryImpl extends java.lang.Object implements android.widget.TabHost.TabContentFactory {\n\t\tconstructor(public owner: SegmentedBar) {\n\t\t\tsuper();\n\n\t\t\treturn global.__native(this);\n\t\t}\n\n\t\tcreateTabContent(tag: string): android.view.View {\n\t\t\tconst tv = new android.widget.TextView(this.owner._context);\n\t\t\tconst isRtl = this.owner.direction === CoreTypes.LayoutDirection.rtl;\n\n\t\t\t// This is collapsed by default and made visible\n\t\t\t// by android when TabItem becomes visible/selected.\n\t\t\t// TODO: Try commenting visibility change.\n\t\t\ttv.setVisibility(VIEW_GONE);\n\t\t\ttv.setMaxLines(1);\n\t\t\ttv.setEllipsize(isRtl ? android.text.TextUtils.TruncateAt.START : android.text.TextUtils.TruncateAt.END);\n\n\t\t\treturn tv;\n\t\t}\n\t}\n\n\t@NativeClass\n\tclass TabHostImpl extends android.widget.TabHost {\n\t\tconstructor(context: android.content.Context, attrs: android.util.AttributeSet) {\n\t\t\tsuper(context, attrs);\n\n\t\t\treturn global.__native(this);\n\t\t}\n\n\t\tpublic onAttachedToWindow(): void {\n\t\t\t// overriden to remove the code that will steal the focus from edit fields.\n\t\t}\n\t}\n\n\tTabHost = TabHostImpl;\n\tTabChangeListener = TabChangeListenerImpl;\n\tTabContentFactory = TabContentFactoryImpl;\n}\n\nexport class SegmentedBarItem extends SegmentedBarItemBase {\n\tdeclare nativeViewProtected: android.widget.TextView;\n\n\tpublic setupNativeView(tabIndex: number): void {\n\t\t// TabHost.TabSpec.setIndicator DOES NOT WORK once the title has been set.\n\t\t// http://stackoverflow.com/questions/2935781/modify-tab-indicator-dynamically-in-android\n\t\tconst titleTextView = <android.widget.TextView>this.parent.nativeViewProtected.getTabWidget().getChildAt(tabIndex).findViewById(TITLE_TEXT_VIEW_ID);\n\n\t\tthis.setNativeView(titleTextView);\n\t\tif (titleTextView) {\n\t\t\tif (this.titleDirty) {\n\t\t\t\tthis._update();\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate titleDirty: boolean;\n\tpublic _update(): void {\n\t\tconst tv = this.nativeViewProtected;\n\t\tif (tv) {\n\t\t\tlet title = this.title;\n\t\t\ttitle = title === null || title === undefined ? '' : title;\n\t\t\ttv.setText(title);\n\t\t\tthis.titleDirty = false;\n\t\t} else {\n\t\t\tthis.titleDirty = true;\n\t\t}\n\t}\n\n\t[colorProperty.getDefault](): number {\n\t\treturn this.nativeViewProtected.getCurrentTextColor();\n\t}\n\t[colorProperty.setNative](value: Color | number) {\n\t\tconst color = value instanceof Color ? value.android : value;\n\t\tthis.nativeViewProtected.setTextColor(color);\n\t}\n\n\t[fontSizeProperty.getDefault](): { nativeSize: number } {\n\t\treturn { nativeSize: this.nativeViewProtected.getTextSize() };\n\t}\n\t[fontSizeProperty.setNative](value: number | { nativeSize: number }) {\n\t\tif (typeof value === 'number') {\n\t\t\tthis.nativeViewProtected.setTextSize(value);\n\t\t} else {\n\t\t\tthis.nativeViewProtected.setTextSize(android.util.TypedValue.COMPLEX_UNIT_PX, value.nativeSize);\n\t\t}\n\t}\n\n\t[fontInternalProperty.getDefault](): android.graphics.Typeface {\n\t\treturn this.nativeViewProtected.getTypeface();\n\t}\n\t[fontInternalProperty.setNative](value: Font | android.graphics.Typeface) {\n\t\tthis.nativeViewProtected.setTypeface(value instanceof Font ? value.getAndroidTypeface() : value);\n\t}\n\n\t[selectedBackgroundColorProperty.getDefault](): android.graphics.drawable.Drawable {\n\t\tconst viewGroup = <android.view.ViewGroup>this.nativeViewProtected.getParent();\n\n\t\treturn viewGroup.getBackground();\n\t}\n\t[selectedBackgroundColorProperty.setNative](value: Color | android.graphics.drawable.Drawable) {\n\t\tconst nativeView = this.nativeViewProtected;\n\t\tconst viewGroup = <android.view.ViewGroup>nativeView.getParent();\n\t\tif (value instanceof Color) {\n\t\t\tconst color = value.android;\n\t\t\tconst backgroundDrawable = viewGroup.getBackground();\n\t\t\tif (SDK_VERSION > 21 && backgroundDrawable) {\n\t\t\t\tconst newDrawable = AndroidHelper.getCopyOrDrawable(backgroundDrawable, nativeView.getResources());\n\t\t\t\tAndroidHelper.setDrawableColor(color, newDrawable);\n\t\t\t\tviewGroup.setBackground(newDrawable);\n\t\t\t} else {\n\t\t\t\tconst stateDrawable = new android.graphics.drawable.StateListDrawable();\n\t\t\t\tconst colorDrawable: android.graphics.drawable.ColorDrawable = new org.nativescript.widgets.SegmentedBarColorDrawable(color, selectedIndicatorThickness);\n\t\t\t\tconst arr = Array.create('int', 1);\n\t\t\t\tarr[0] = R_ATTR_STATE_SELECTED;\n\t\t\t\tstateDrawable.addState(arr, colorDrawable);\n\t\t\t\tstateDrawable.setBounds(0, 15, viewGroup.getRight(), viewGroup.getBottom());\n\t\t\t\tviewGroup.setBackground(stateDrawable);\n\t\t\t}\n\t\t} else {\n\t\t\tconst backgroundDrawable = AndroidHelper.getCopyOrDrawable(value, nativeView.getResources());\n\t\t\tviewGroup.setBackground(backgroundDrawable);\n\t\t}\n\t}\n}\n\nexport class SegmentedBar extends SegmentedBarBase {\n\tdeclare nativeViewProtected: android.widget.TabHost;\n\tprivate _tabContentFactory: android.widget.TabHost.TabContentFactory;\n\tprivate _addingTab: boolean;\n\n\tpublic shouldChangeSelectedIndex(): boolean {\n\t\treturn !this._addingTab;\n\t}\n\n\tpublic createNativeView() {\n\t\tinitializeNativeClasses();\n\n\t\tconst context: android.content.Context = this._context;\n\t\tconst nativeView = new TabHost(context, null);\n\n\t\tconst tabHostLayout = new android.widget.LinearLayout(context);\n\t\ttabHostLayout.setOrientation(android.widget.LinearLayout.VERTICAL);\n\n\t\tconst tabWidget = new android.widget.TabWidget(context);\n\t\ttabWidget.setId(R_ID_TABS);\n\t\ttabHostLayout.addView(tabWidget);\n\n\t\tconst frame = new android.widget.FrameLayout(context);\n\t\tframe.setId(R_ID_TABCONTENT);\n\t\tframe.setVisibility(VIEW_GONE);\n\t\ttabHostLayout.addView(frame);\n\n\t\tnativeView.addView(tabHostLayout);\n\n\t\treturn nativeView;\n\t}\n\n\tpublic initNativeView(): void {\n\t\tsuper.initNativeView();\n\t\tconst nativeView = this.nativeViewProtected;\n\t\tconst listener = new TabChangeListener(this);\n\t\tnativeView.setOnTabChangedListener(listener);\n\t\t(<any>nativeView).listener = listener;\n\t\tnativeView.setup();\n\t\tthis._tabContentFactory = this._tabContentFactory || new TabContentFactory(this);\n\t}\n\n\tpublic disposeNativeView() {\n\t\tconst nativeView: any = this.nativeViewProtected;\n\t\tif (nativeView?.listener) {\n\t\t\tnativeView.listener.owner = null;\n\t\t}\n\t\tsuper.disposeNativeView();\n\t}\n\n\tpublic onLoaded() {\n\t\tsuper.onLoaded();\n\n\t\t// Can only be applied after view is loaded\n\t\tconst tabWidget = this.nativeViewProtected.getTabWidget();\n\t\tif (tabWidget) {\n\t\t\ttabWidget.setEnabled(tabWidget.isEnabled());\n\t\t}\n\t}\n\n\tprivate insertTab(tabItem: SegmentedBarItem, index: number): void {\n\t\tconst tabHost = this.nativeViewProtected;\n\t\tconst tab = tabHost.newTabSpec(index + '');\n\t\ttab.setIndicator(tabItem.title + '');\n\t\ttab.setContent(this._tabContentFactory);\n\n\t\tthis._addingTab = true;\n\t\ttabHost.addTab(tab);\n\t\ttabItem.setupNativeView(index);\n\t\tthis._addingTab = false;\n\t}\n\n\t[selectedIndexProperty.getDefault](): number {\n\t\treturn -1;\n\t}\n\t[selectedIndexProperty.setNative](value: number) {\n\t\tthis.nativeViewProtected.setCurrentTab(value);\n\t}\n\n\t[itemsProperty.getDefault](): SegmentedBarItem[] {\n\t\treturn null;\n\t}\n\t[itemsProperty.setNative](value: SegmentedBarItem[]) {\n\t\tthis.nativeViewProtected.clearAllTabs();\n\n\t\tconst newItems = value;\n\t\tif (newItems) {\n\t\t\tnewItems.forEach((item, i, arr) => this.insertTab(item, i));\n\t\t}\n\n\t\tselectedIndexProperty.coerce(this);\n\t}\n\t[isEnabledProperty.setNative](value: boolean) {\n\t\tconst tabWidget = this.nativeViewProtected.getTabWidget();\n\t\tif (tabWidget) {\n\t\t\ttabWidget.setEnabled(value);\n\t\t}\n\t}\n\tpublic setTabColor(index) {\n\t\ttry {\n\t\t\tconst tabWidget = this.nativeViewProtected?.getTabWidget();\n\t\t\tif (tabWidget) {\n\t\t\t\tconst unselectedTextColor = this.getColorForAndroid(this.color ?? '#6e6e6e');\n\t\t\t\tconst selectedTextColor = this.getColorForAndroid(this?.selectedTextColor ?? '#000000');\n\t\t\t\tconst unselectedBackgroundColor = this.getColorForAndroid(this?.backgroundColor ?? '#dbdbdb');\n\t\t\t\tconst selectedBackgroundColor = this.getColorForAndroid(this?.selectedBackgroundColor ?? this?.backgroundColor ?? 'blue');\n\t\t\t\tif (tabWidget) {\n\t\t\t\t\tfor (let i = 0; i < tabWidget.getTabCount(); i++) {\n\t\t\t\t\t\tconst view = tabWidget.getChildTabViewAt(i);\n\t\t\t\t\t\tconst item = this.items[i];\n\t\t\t\t\t\tconst textView = item?.nativeViewProtected;\n\t\t\t\t\t\tview.setBackgroundColor(unselectedBackgroundColor);\n\t\t\t\t\t\tif (textView) {\n\t\t\t\t\t\t\ttextView.setTextColor(unselectedTextColor);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (index == i) {\n\t\t\t\t\t\t\tview.setBackgroundColor(selectedBackgroundColor);\n\t\t\t\t\t\t\tif (textView) {\n\t\t\t\t\t\t\t\ttextView.setTextColor(selectedTextColor);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tTrace.error(e);\n\t\t}\n\t}\n\tprivate getColorForAndroid(color: string | Color): number {\n\t\tif (typeof color === 'string') {\n\t\t\treturn new Color(color).android;\n\t\t} else if (color instanceof Color) {\n\t\t\treturn color.android;\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"file":"index.android.js","sourceRoot":"","sources":["../../../../../packages/core/ui/segmented-bar/index.android.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,aAAa,EAAE,+BAA+B,EAA6B,MAAM,wBAAwB,CAAC;AAClL,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpG,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,cAAc,wBAAwB,CAAC;AAEvC,MAAM,SAAS,GAAG,UAAU,CAAC;AAC7B,MAAM,eAAe,GAAG,UAAU,CAAC;AACnC,MAAM,qBAAqB,GAAG,UAAU,CAAC;AACzC,MAAM,kBAAkB,GAAG,QAAQ,CAAC,CAAC,iEAAiE;AActG,I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CAAC;4BAC1C,CAAC;4BACD,SAAS;wBACV,CAAC;oBACF,CAAC;gBACF,CAAC;YACF,CAAC;QACF,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACZ,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAChB,CAAC;IACF,CAAC;IACO,kBAAkB,CAAC,KAAqB;QAC/C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC/B,OAAO,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;QACjC,CAAC;aAAM,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;YACnC,OAAO,KAAK,CAAC,OAAO,CAAC;QACtB,CAAC;IACF,CAAC;CACD","sourcesContent":["import { Font } from '../styling/font';\nimport { SegmentedBarItemBase, SegmentedBarBase, selectedIndexProperty, itemsProperty, selectedBackgroundColorProperty, selectedTextColorProperty } from './segmented-bar-common';\nimport { AndroidHelper, isEnabledProperty } from '../core/view';\nimport { colorProperty, fontInternalProperty, fontSizeProperty } from '../styling/style-properties';\nimport { Color } from '../../color';\nimport { android as androidUtils, layout } from '../../utils';\nimport { SDK_VERSION } from '../../utils/constants';\nimport { VIEW_GONE } from '../core/view/index.android';\nimport { Trace } from '../../trace';\nimport { CoreTypes } from '../../core-types';\n\nexport * from './segmented-bar-common';\n\nconst R_ID_TABS = 0x01020013;\nconst R_ID_TABCONTENT = 0x01020011;\nconst R_ATTR_STATE_SELECTED = 0x010100a1;\nconst TITLE_TEXT_VIEW_ID = 16908310; // http://developer.android.com/reference/android/R.id.html#title\n\ninterface TabChangeListener {\n\tnew (owner: SegmentedBar): android.widget.TabHost.OnTabChangeListener;\n}\n\ninterface TabContentFactory {\n\tnew (owner: SegmentedBar): android.widget.TabHost.TabContentFactory;\n}\n\ninterface TabHost {\n\tnew (context: android.content.Context, attrs: android.util.AttributeSet): android.widget.TabHost;\n}\n\nlet selectedIndicatorThickness: number;\n\nlet TabHost: TabHost;\nlet TabChangeListener: TabChangeListener;\nlet TabContentFactory: TabContentFactory;\n\n// TODO: All TabHost public methods become deprecated in API 30.\nfunction initializeNativeClasses(): void {\n\tif (TabChangeListener) {\n\t\treturn;\n\t}\n\n\t// Indicator thickness for material - 2dip. For pre-material - 5dip.\n\tselectedIndicatorThickness = layout.toDevicePixels(SDK_VERSION >= 21 ? 2 : 5);\n\n\t@NativeClass\n\t@Interfaces([android.widget.TabHost.OnTabChangeListener])\n\tclass TabChangeListenerImpl extends java.lang.Object implements android.widget.TabHost.OnTabChangeListener {\n\t\tconstructor(public owner: SegmentedBar) {\n\t\t\tsuper();\n\t\t}\n\n\t\tonTabChanged(id: string): void {\n\t\t\tconst owner = this.owner;\n\t\t\tif (owner) {\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\towner.setTabColor(id);\n\t\t\t\t});\n\t\t\t\tif (owner.shouldChangeSelectedIndex()) {\n\t\t\t\t\towner.selectedIndex = parseInt(id);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t@NativeClass\n\t@Interfaces([android.widget.TabHost.TabContentFactory])\n\tclass TabContentFactoryImpl extends java.lang.Object implements android.widget.TabHost.TabContentFactory {\n\t\t// Weak: the bar holds this factory, so a strong owner would be a cycle\n\t\t// through the factory's native counterpart.\n\t\tprivate owner: WeakRef<SegmentedBar>;\n\n\t\tconstructor(owner: SegmentedBar) {\n\t\t\tsuper();\n\t\t\tthis.owner = new WeakRef(owner);\n\t\t}\n\n\t\tcreateTabContent(tag: string): android.view.View {\n\t\t\tconst owner = this.owner.deref();\n\t\t\tconst tv = new android.widget.TextView(owner ? owner._context : androidUtils.getApplicationContext());\n\t\t\tconst isRtl = owner?.direction === CoreTypes.LayoutDirection.rtl;\n\n\t\t\t// This is collapsed by default and made visible\n\t\t\t// by android when TabItem becomes visible/selected.\n\t\t\t// TODO: Try commenting visibility change.\n\t\t\ttv.setVisibility(VIEW_GONE);\n\t\t\ttv.setMaxLines(1);\n\t\t\ttv.setEllipsize(isRtl ? android.text.TextUtils.TruncateAt.START : android.text.TextUtils.TruncateAt.END);\n\n\t\t\treturn tv;\n\t\t}\n\t}\n\n\t@NativeClass\n\tclass TabHostImpl extends android.widget.TabHost {\n\t\tconstructor(context: android.content.Context, attrs: android.util.AttributeSet) {\n\t\t\tsuper(context, attrs);\n\t\t}\n\n\t\tpublic onAttachedToWindow(): void {\n\t\t\t// overriden to remove the code that will steal the focus from edit fields.\n\t\t}\n\t}\n\n\tTabHost = TabHostImpl;\n\tTabChangeListener = TabChangeListenerImpl;\n\tTabContentFactory = TabContentFactoryImpl;\n}\n\nexport class SegmentedBarItem extends SegmentedBarItemBase {\n\tdeclare nativeViewProtected: android.widget.TextView;\n\n\tpublic setupNativeView(tabIndex: number): void {\n\t\t// TabHost.TabSpec.setIndicator DOES NOT WORK once the title has been set.\n\t\t// http://stackoverflow.com/questions/2935781/modify-tab-indicator-dynamically-in-android\n\t\tconst titleTextView = <android.widget.TextView>this.parent.nativeViewProtected.getTabWidget().getChildAt(tabIndex).findViewById(TITLE_TEXT_VIEW_ID);\n\n\t\tthis.setNativeView(titleTextView);\n\t\tif (titleTextView) {\n\t\t\tif (this.titleDirty) {\n\t\t\t\tthis._update();\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate titleDirty: boolean;\n\tpublic _update(): void {\n\t\tconst tv = this.nativeViewProtected;\n\t\tif (tv) {\n\t\t\tlet title = this.title;\n\t\t\ttitle = title === null || title === undefined ? '' : title;\n\t\t\ttv.setText(title);\n\t\t\tthis.titleDirty = false;\n\t\t} else {\n\t\t\tthis.titleDirty = true;\n\t\t}\n\t}\n\n\t[colorProperty.getDefault](): number {\n\t\treturn this.nativeViewProtected.getCurrentTextColor();\n\t}\n\t[colorProperty.setNative](value: Color | number) {\n\t\tconst color = value instanceof Color ? value.android : value;\n\t\tthis.nativeViewProtected.setTextColor(color);\n\t}\n\n\t[fontSizeProperty.getDefault](): { nativeSize: number } {\n\t\treturn { nativeSize: this.nativeViewProtected.getTextSize() };\n\t}\n\t[fontSizeProperty.setNative](value: number | { nativeSize: number }) {\n\t\tif (typeof value === 'number') {\n\t\t\tthis.nativeViewProtected.setTextSize(value);\n\t\t} else {\n\t\t\tthis.nativeViewProtected.setTextSize(android.util.TypedValue.COMPLEX_UNIT_PX, value.nativeSize);\n\t\t}\n\t}\n\n\t[fontInternalProperty.getDefault](): android.graphics.Typeface {\n\t\treturn this.nativeViewProtected.getTypeface();\n\t}\n\t[fontInternalProperty.setNative](value: Font | android.graphics.Typeface) {\n\t\tthis.nativeViewProtected.setTypeface(value instanceof Font ? value.getAndroidTypeface() : value);\n\t}\n\n\t[selectedBackgroundColorProperty.getDefault](): android.graphics.drawable.Drawable {\n\t\tconst viewGroup = <android.view.ViewGroup>this.nativeViewProtected.getParent();\n\n\t\treturn viewGroup.getBackground();\n\t}\n\t[selectedBackgroundColorProperty.setNative](value: Color | android.graphics.drawable.Drawable) {\n\t\tconst nativeView = this.nativeViewProtected;\n\t\tconst viewGroup = <android.view.ViewGroup>nativeView.getParent();\n\t\tif (value instanceof Color) {\n\t\t\tconst color = value.android;\n\t\t\tconst backgroundDrawable = viewGroup.getBackground();\n\t\t\tif (SDK_VERSION > 21 && backgroundDrawable) {\n\t\t\t\tconst newDrawable = AndroidHelper.getCopyOrDrawable(backgroundDrawable, nativeView.getResources());\n\t\t\t\tAndroidHelper.setDrawableColor(color, newDrawable);\n\t\t\t\tviewGroup.setBackground(newDrawable);\n\t\t\t} else {\n\t\t\t\tconst stateDrawable = new android.graphics.drawable.StateListDrawable();\n\t\t\t\tconst colorDrawable: android.graphics.drawable.ColorDrawable = new org.nativescript.widgets.SegmentedBarColorDrawable(color, selectedIndicatorThickness);\n\t\t\t\tconst arr = Array.create('int', 1);\n\t\t\t\tarr[0] = R_ATTR_STATE_SELECTED;\n\t\t\t\tstateDrawable.addState(arr, colorDrawable);\n\t\t\t\tstateDrawable.setBounds(0, 15, viewGroup.getRight(), viewGroup.getBottom());\n\t\t\t\tviewGroup.setBackground(stateDrawable);\n\t\t\t}\n\t\t} else {\n\t\t\tconst backgroundDrawable = AndroidHelper.getCopyOrDrawable(value, nativeView.getResources());\n\t\t\tviewGroup.setBackground(backgroundDrawable);\n\t\t}\n\t}\n}\n\nexport class SegmentedBar extends SegmentedBarBase {\n\tdeclare nativeViewProtected: android.widget.TabHost;\n\tprivate _tabContentFactory: android.widget.TabHost.TabContentFactory;\n\tprivate _addingTab: boolean;\n\n\tpublic shouldChangeSelectedIndex(): boolean {\n\t\treturn !this._addingTab;\n\t}\n\n\tpublic createNativeView() {\n\t\tinitializeNativeClasses();\n\n\t\tconst context: android.content.Context = this._context;\n\t\tconst nativeView = new TabHost(context, null);\n\n\t\tconst tabHostLayout = new android.widget.LinearLayout(context);\n\t\ttabHostLayout.setOrientation(android.widget.LinearLayout.VERTICAL);\n\n\t\tconst tabWidget = new android.widget.TabWidget(context);\n\t\ttabWidget.setId(R_ID_TABS);\n\t\ttabHostLayout.addView(tabWidget);\n\n\t\tconst frame = new android.widget.FrameLayout(context);\n\t\tframe.setId(R_ID_TABCONTENT);\n\t\tframe.setVisibility(VIEW_GONE);\n\t\ttabHostLayout.addView(frame);\n\n\t\tnativeView.addView(tabHostLayout);\n\n\t\treturn nativeView;\n\t}\n\n\tpublic initNativeView(): void {\n\t\tsuper.initNativeView();\n\t\tconst nativeView = this.nativeViewProtected;\n\t\tconst listener = new TabChangeListener(this);\n\t\tnativeView.setOnTabChangedListener(listener);\n\t\t(<any>nativeView).listener = listener;\n\t\tnativeView.setup();\n\t\tthis._tabContentFactory = this._tabContentFactory || new TabContentFactory(this);\n\t}\n\n\tpublic disposeNativeView() {\n\t\tconst nativeView: any = this.nativeViewProtected;\n\t\tif (nativeView?.listener) {\n\t\t\tnativeView.listener.owner = null;\n\t\t}\n\t\tsuper.disposeNativeView();\n\t}\n\n\tpublic onLoaded() {\n\t\tsuper.onLoaded();\n\n\t\t// Can only be applied after view is loaded\n\t\tconst tabWidget = this.nativeViewProtected.getTabWidget();\n\t\tif (tabWidget) {\n\t\t\ttabWidget.setEnabled(tabWidget.isEnabled());\n\t\t}\n\t}\n\n\tprivate insertTab(tabItem: SegmentedBarItem, index: number): void {\n\t\tconst tabHost = this.nativeViewProtected;\n\t\tconst tab = tabHost.newTabSpec(index + '');\n\t\ttab.setIndicator(tabItem.title + '');\n\t\ttab.setContent(this._tabContentFactory);\n\n\t\tthis._addingTab = true;\n\t\ttabHost.addTab(tab);\n\t\ttabItem.setupNativeView(index);\n\t\tthis._addingTab = false;\n\t}\n\n\t[selectedIndexProperty.getDefault](): number {\n\t\treturn -1;\n\t}\n\t[selectedIndexProperty.setNative](value: number) {\n\t\tthis.nativeViewProtected.setCurrentTab(value);\n\t}\n\n\t[itemsProperty.getDefault](): SegmentedBarItem[] {\n\t\treturn null;\n\t}\n\t[itemsProperty.setNative](value: SegmentedBarItem[]) {\n\t\tthis.nativeViewProtected.clearAllTabs();\n\n\t\tconst newItems = value;\n\t\tif (newItems) {\n\t\t\tnewItems.forEach((item, i, arr) => this.insertTab(item, i));\n\t\t}\n\n\t\tselectedIndexProperty.coerce(this);\n\t}\n\t[isEnabledProperty.setNative](value: boolean) {\n\t\tconst tabWidget = this.nativeViewProtected.getTabWidget();\n\t\tif (tabWidget) {\n\t\t\ttabWidget.setEnabled(value);\n\t\t}\n\t}\n\tpublic setTabColor(index) {\n\t\ttry {\n\t\t\tconst tabWidget = this.nativeViewProtected?.getTabWidget();\n\t\t\tif (tabWidget) {\n\t\t\t\tconst unselectedTextColor = this.getColorForAndroid(this.color ?? '#6e6e6e');\n\t\t\t\tconst selectedTextColor = this.getColorForAndroid(this?.selectedTextColor ?? '#000000');\n\t\t\t\tconst unselectedBackgroundColor = this.getColorForAndroid(this?.backgroundColor ?? '#dbdbdb');\n\t\t\t\tconst selectedBackgroundColor = this.getColorForAndroid(this?.selectedBackgroundColor ?? this?.backgroundColor ?? 'blue');\n\t\t\t\tif (tabWidget) {\n\t\t\t\t\tfor (let i = 0; i < tabWidget.getTabCount(); i++) {\n\t\t\t\t\t\tconst view = tabWidget.getChildTabViewAt(i);\n\t\t\t\t\t\tconst item = this.items[i];\n\t\t\t\t\t\tconst textView = item?.nativeViewProtected;\n\t\t\t\t\t\tview.setBackgroundColor(unselectedBackgroundColor);\n\t\t\t\t\t\tif (textView) {\n\t\t\t\t\t\t\ttextView.setTextColor(unselectedTextColor);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (index == i) {\n\t\t\t\t\t\t\tview.setBackgroundColor(selectedBackgroundColor);\n\t\t\t\t\t\t\tif (textView) {\n\t\t\t\t\t\t\t\ttextView.setTextColor(selectedTextColor);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tTrace.error(e);\n\t\t}\n\t}\n\tprivate getColorForAndroid(color: string | Color): number {\n\t\tif (typeof color === 'string') {\n\t\t\treturn new Color(color).android;\n\t\t} else if (color instanceof Color) {\n\t\t\treturn color.android;\n\t\t}\n\t}\n}\n"]}
@@ -11,8 +11,7 @@ function initializeListenerClass() {
11
11
  var SeekBarChangeListenerImpl = (function (_super) {
12
12
  __extends(SeekBarChangeListenerImpl, _super);
13
13
  function SeekBarChangeListenerImpl() {
14
- var _this = _super.call(this) || this;
15
- return global.__native(_this);
14
+ return _super.call(this) || this;
16
15
  }
17
16
  SeekBarChangeListenerImpl.prototype.onProgressChanged = function (seekBar, progress, fromUser) {
18
17
  var owner = seekBar.owner;
@@ -1 +1 @@
1
- {"version":3,"file":"index.android.js","sourceRoot":"","sources":["../../../../../packages/core/ui/slider/index.android.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAChG,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACjH,OAAO,EAAE,KAAK,EAA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6DAA6D;QAC7D,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,yBAAyB;QACvE,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,WAAW,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;QAElE,aAAa,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC;QACnE,aAAa,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC;QAEnE,kBAAkB;QAClB,UAAU,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAC;QAE9C,qDAAqD;QACrD,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAEhC,0CAA0C;QAC1C,UAAU,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;QACrC,UAAU,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;QAErC,yBAAyB;QACzB,MAAM,eAAe,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC;QACjD,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QAC1B,UAAU,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IACzC,CAAC;CACD","sourcesContent":["import { Background } from '../styling/background';\nimport { SliderBase, valueProperty, minValueProperty, maxValueProperty } from './slider-common';\nimport { colorProperty, backgroundColorProperty, backgroundInternalProperty } from '../styling/style-properties';\nimport { Color } from '../../color';\nimport { AndroidHelper } from '../core/view';\nimport { LinearGradient } from '../styling/linear-gradient';\n\nexport * from './slider-common';\n\ninterface OwnerSeekBar extends android.widget.SeekBar {\n\towner: Slider;\n}\n\nlet SeekBar: typeof android.widget.SeekBar;\nlet SeekBarChangeListener: android.widget.SeekBar.OnSeekBarChangeListener;\n\nfunction initializeListenerClass(): void {\n\tif (!SeekBarChangeListener) {\n\t\t@NativeClass\n\t\t@Interfaces([android.widget.SeekBar.OnSeekBarChangeListener])\n\t\tclass SeekBarChangeListenerImpl extends java.lang.Object implements android.widget.SeekBar.OnSeekBarChangeListener {\n\t\t\tconstructor() {\n\t\t\t\tsuper();\n\n\t\t\t\treturn global.__native(this);\n\t\t\t}\n\n\t\t\tonProgressChanged(seekBar: OwnerSeekBar, progress: number, fromUser: boolean): void {\n\t\t\t\tconst owner = seekBar.owner;\n\t\t\t\tif (owner && !owner._supressNativeValue) {\n\t\t\t\t\tconst newValue = progress + owner.minValue;\n\t\t\t\t\tvalueProperty.nativeValueChange(owner, newValue);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tonStartTrackingTouch(seekBar: OwnerSeekBar): void {\n\t\t\t\t//\n\t\t\t}\n\n\t\t\tonStopTrackingTouch(seekBar: OwnerSeekBar): void {\n\t\t\t\t//\n\t\t\t}\n\t\t}\n\n\t\tSeekBarChangeListener = new SeekBarChangeListenerImpl();\n\t}\n}\n\nfunction getListener(): android.widget.SeekBar.OnSeekBarChangeListener {\n\treturn SeekBarChangeListener;\n}\n\nexport class Slider extends SliderBase {\n\t_supressNativeValue: boolean;\n\tdeclare nativeViewProtected: OwnerSeekBar;\n\n\tpublic createNativeView() {\n\t\tif (!SeekBar) {\n\t\t\tSeekBar = android.widget.SeekBar;\n\t\t}\n\n\t\treturn new SeekBar(this._context);\n\t}\n\n\tpublic initNativeView(): void {\n\t\tsuper.initNativeView();\n\t\tconst nativeView = this.nativeViewProtected;\n\t\tnativeView.owner = this;\n\t\tinitializeListenerClass();\n\t\tconst listener = getListener();\n\t\tnativeView.setOnSeekBarChangeListener(listener);\n\t}\n\n\tpublic disposeNativeView() {\n\t\tthis.nativeViewProtected.owner = null;\n\t\tsuper.disposeNativeView();\n\t}\n\n\t/**\n\t * There is no minValue in Android. We simulate this by subtracting the minValue from the native value and maxValue.\n\t * We need this method to call native setMax and setProgress methods when minValue property is changed,\n\t * without handling the native value changed callback.\n\t */\n\tprivate setNativeValuesSilently() {\n\t\tthis._supressNativeValue = true;\n\t\tconst nativeView = this.nativeViewProtected;\n\t\ttry {\n\t\t\tnativeView.setMax(this.maxValue - this.minValue);\n\t\t\tnativeView.setProgress(this.value - this.minValue);\n\t\t} finally {\n\t\t\tthis._supressNativeValue = false;\n\t\t}\n\t}\n\n\t[valueProperty.setNative](value: number) {\n\t\tthis.setNativeValuesSilently();\n\t}\n\n\t[minValueProperty.setNative](value: number) {\n\t\tthis.setNativeValuesSilently();\n\t}\n\n\t[maxValueProperty.getDefault](): number {\n\t\treturn 100;\n\t}\n\t[maxValueProperty.setNative](value: number) {\n\t\tthis.setNativeValuesSilently();\n\t}\n\n\t[colorProperty.getDefault](): number {\n\t\treturn -1;\n\t}\n\t[colorProperty.setNative](value: number | Color) {\n\t\tconst drawable = this.nativeViewProtected.getThumb();\n\t\tif (value instanceof Color) {\n\t\t\tAndroidHelper.setDrawableColor(value.android, drawable);\n\t\t} else {\n\t\t\tAndroidHelper.clearDrawableColor(drawable);\n\t\t}\n\t}\n\n\t[backgroundColorProperty.getDefault](): number {\n\t\treturn -1;\n\t}\n\t[backgroundColorProperty.setNative](value: number | Color) {\n\t\tconst drawable = this.nativeViewProtected.getProgressDrawable();\n\t\tif (value instanceof Color) {\n\t\t\tAndroidHelper.setDrawableColor(value.android, drawable);\n\t\t} else {\n\t\t\tAndroidHelper.clearDrawableColor(drawable);\n\t\t}\n\t}\n\n\t[backgroundInternalProperty.getDefault](): Background {\n\t\treturn null;\n\t}\n\t[backgroundInternalProperty.setNative](value: Background) {\n\t\tif (value && value.image instanceof LinearGradient) {\n\t\t\tthis._applyGradientToTrack(value.image);\n\t\t}\n\t}\n\n\tprivate _applyGradientToTrack(gradient: LinearGradient): void {\n\t\tconst nativeView = this.nativeViewProtected;\n\t\tif (!nativeView) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get dimensions\n\t\tconst density = nativeView.getContext().getResources().getDisplayMetrics().density;\n\t\tconst width = nativeView.getWidth() || 1000;\n\t\tconst trackHeight = Math.round(3 * density); // 3dp track height to match iOS\n\t\tconst cornerRadius = trackHeight / 2;\n\n\t\t// Create colors array from gradient stops\n\t\tconst colors = Array.create('int', gradient.colorStops.length);\n\t\tgradient.colorStops.forEach((stop, index) => {\n\t\t\tcolors[index] = stop.color.android;\n\t\t});\n\n\t\t// Create semi-transparent colors for background\n\t\tconst bgColors = Array.create('int', gradient.colorStops.length);\n\t\tgradient.colorStops.forEach((stop, index) => {\n\t\t\tconst color = stop.color;\n\t\t\tconst alpha = Math.round(color.a * 0.3);\n\t\t\tbgColors[index] = android.graphics.Color.argb(alpha, color.r, color.g, color.b);\n\t\t});\n\n\t\t// Create rounded corner radii\n\t\tconst radii = Array.create('float', 8);\n\t\tfor (let i = 0; i < 8; i++) {\n\t\t\tradii[i] = cornerRadius;\n\t\t}\n\n\t\t// Background track - use GradientDrawable for proper sizing\n\t\tconst bgDrawable = new android.graphics.drawable.GradientDrawable();\n\t\tbgDrawable.setOrientation(android.graphics.drawable.GradientDrawable.Orientation.LEFT_RIGHT);\n\t\tbgDrawable.setColors(bgColors);\n\t\tbgDrawable.setCornerRadius(cornerRadius);\n\t\tbgDrawable.setShape(android.graphics.drawable.GradientDrawable.RECTANGLE);\n\n\t\t// Progress track - use GradientDrawable\n\t\tconst progressDrawable = new android.graphics.drawable.GradientDrawable();\n\t\tprogressDrawable.setOrientation(android.graphics.drawable.GradientDrawable.Orientation.LEFT_RIGHT);\n\t\tprogressDrawable.setColors(colors);\n\t\tprogressDrawable.setCornerRadius(cornerRadius);\n\t\tprogressDrawable.setShape(android.graphics.drawable.GradientDrawable.RECTANGLE);\n\n\t\t// Wrap progress in ClipDrawable for clipping based on progress\n\t\tconst progressClip = new android.graphics.drawable.ClipDrawable(progressDrawable, android.view.Gravity.LEFT, android.graphics.drawable.ClipDrawable.HORIZONTAL);\n\n\t\t// Create LayerDrawable with both layers\n\t\tconst layers = Array.create(android.graphics.drawable.Drawable, 2);\n\t\tlayers[0] = bgDrawable;\n\t\tlayers[1] = progressClip;\n\n\t\tconst layerDrawable = new android.graphics.drawable.LayerDrawable(layers);\n\t\tlayerDrawable.setId(0, android.R.id.background);\n\t\tlayerDrawable.setId(1, android.R.id.progress);\n\n\t\t// Set layer height using setLayerSize (API 23+) or setLayerInset\n\t\t// Use setLayerHeight to constrain the actual drawable height\n\t\tconst thumbHeight = Math.round(20 * density); // Approximate thumb size\n\t\tconst verticalInset = Math.round((thumbHeight - trackHeight) / 2);\n\n\t\tlayerDrawable.setLayerInset(0, 0, verticalInset, 0, verticalInset);\n\t\tlayerDrawable.setLayerInset(1, 0, verticalInset, 0, verticalInset);\n\n\t\t// Apply to slider\n\t\tnativeView.setProgressDrawable(layerDrawable);\n\n\t\t// Disable split track to remove the gap behind thumb\n\t\tnativeView.setSplitTrack(false);\n\n\t\t// Set max height to constrain the SeekBar\n\t\tnativeView.setMaxHeight(thumbHeight);\n\t\tnativeView.setMinHeight(thumbHeight);\n\n\t\t// Force refresh progress\n\t\tconst currentProgress = nativeView.getProgress();\n\t\tnativeView.setProgress(0);\n\t\tnativeView.setProgress(currentProgress);\n\t}\n}\n"]}
1
+ {"version":3,"file":"index.android.js","sourceRoot":"","sources":["../../../../../packages/core/ui/slider/index.android.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAChG,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACjH,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,cAAc,iBAAiB,CAAC;AAMhC,IAAI,OAAsC,CAAC;AAC3C,IAAI,qBAAqE,CAAC;AAE1E,SAAS,uBAAuB;IAC/B,IAAI,CAAC,qBAAqB,EAAE,CAAC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,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC;QACnE,aAAa,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC;QAEnE,kBAAkB;QAClB,UAAU,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAC;QAE9C,qDAAqD;QACrD,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAEhC,0CAA0C;QAC1C,UAAU,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;QACrC,UAAU,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;QAErC,yBAAyB;QACzB,MAAM,eAAe,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC;QACjD,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QAC1B,UAAU,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IACzC,CAAC;CACD","sourcesContent":["import { Background } from '../styling/background';\nimport { SliderBase, valueProperty, minValueProperty, maxValueProperty } from './slider-common';\nimport { colorProperty, backgroundColorProperty, backgroundInternalProperty } from '../styling/style-properties';\nimport { Color } from '../../color';\nimport { AndroidHelper } from '../core/view';\nimport { LinearGradient } from '../styling/linear-gradient';\n\nexport * from './slider-common';\n\ninterface OwnerSeekBar extends android.widget.SeekBar {\n\towner: Slider;\n}\n\nlet SeekBar: typeof android.widget.SeekBar;\nlet SeekBarChangeListener: android.widget.SeekBar.OnSeekBarChangeListener;\n\nfunction initializeListenerClass(): void {\n\tif (!SeekBarChangeListener) {\n\t\t@NativeClass\n\t\t@Interfaces([android.widget.SeekBar.OnSeekBarChangeListener])\n\t\tclass SeekBarChangeListenerImpl extends java.lang.Object implements android.widget.SeekBar.OnSeekBarChangeListener {\n\t\t\tconstructor() {\n\t\t\t\tsuper();\n\t\t\t}\n\n\t\t\tonProgressChanged(seekBar: OwnerSeekBar, progress: number, fromUser: boolean): void {\n\t\t\t\tconst owner = seekBar.owner;\n\t\t\t\tif (owner && !owner._supressNativeValue) {\n\t\t\t\t\tconst newValue = progress + owner.minValue;\n\t\t\t\t\tvalueProperty.nativeValueChange(owner, newValue);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tonStartTrackingTouch(seekBar: OwnerSeekBar): void {\n\t\t\t\t//\n\t\t\t}\n\n\t\t\tonStopTrackingTouch(seekBar: OwnerSeekBar): void {\n\t\t\t\t//\n\t\t\t}\n\t\t}\n\n\t\tSeekBarChangeListener = new SeekBarChangeListenerImpl();\n\t}\n}\n\nfunction getListener(): android.widget.SeekBar.OnSeekBarChangeListener {\n\treturn SeekBarChangeListener;\n}\n\nexport class Slider extends SliderBase {\n\t_supressNativeValue: boolean;\n\tdeclare nativeViewProtected: OwnerSeekBar;\n\n\tpublic createNativeView() {\n\t\tif (!SeekBar) {\n\t\t\tSeekBar = android.widget.SeekBar;\n\t\t}\n\n\t\treturn new SeekBar(this._context);\n\t}\n\n\tpublic initNativeView(): void {\n\t\tsuper.initNativeView();\n\t\tconst nativeView = this.nativeViewProtected;\n\t\tnativeView.owner = this;\n\t\tinitializeListenerClass();\n\t\tconst listener = getListener();\n\t\tnativeView.setOnSeekBarChangeListener(listener);\n\t}\n\n\tpublic disposeNativeView() {\n\t\tthis.nativeViewProtected.owner = null;\n\t\tsuper.disposeNativeView();\n\t}\n\n\t/**\n\t * There is no minValue in Android. We simulate this by subtracting the minValue from the native value and maxValue.\n\t * We need this method to call native setMax and setProgress methods when minValue property is changed,\n\t * without handling the native value changed callback.\n\t */\n\tprivate setNativeValuesSilently() {\n\t\tthis._supressNativeValue = true;\n\t\tconst nativeView = this.nativeViewProtected;\n\t\ttry {\n\t\t\tnativeView.setMax(this.maxValue - this.minValue);\n\t\t\tnativeView.setProgress(this.value - this.minValue);\n\t\t} finally {\n\t\t\tthis._supressNativeValue = false;\n\t\t}\n\t}\n\n\t[valueProperty.setNative](value: number) {\n\t\tthis.setNativeValuesSilently();\n\t}\n\n\t[minValueProperty.setNative](value: number) {\n\t\tthis.setNativeValuesSilently();\n\t}\n\n\t[maxValueProperty.getDefault](): number {\n\t\treturn 100;\n\t}\n\t[maxValueProperty.setNative](value: number) {\n\t\tthis.setNativeValuesSilently();\n\t}\n\n\t[colorProperty.getDefault](): number {\n\t\treturn -1;\n\t}\n\t[colorProperty.setNative](value: number | Color) {\n\t\tconst drawable = this.nativeViewProtected.getThumb();\n\t\tif (value instanceof Color) {\n\t\t\tAndroidHelper.setDrawableColor(value.android, drawable);\n\t\t} else {\n\t\t\tAndroidHelper.clearDrawableColor(drawable);\n\t\t}\n\t}\n\n\t[backgroundColorProperty.getDefault](): number {\n\t\treturn -1;\n\t}\n\t[backgroundColorProperty.setNative](value: number | Color) {\n\t\tconst drawable = this.nativeViewProtected.getProgressDrawable();\n\t\tif (value instanceof Color) {\n\t\t\tAndroidHelper.setDrawableColor(value.android, drawable);\n\t\t} else {\n\t\t\tAndroidHelper.clearDrawableColor(drawable);\n\t\t}\n\t}\n\n\t[backgroundInternalProperty.getDefault](): Background {\n\t\treturn null;\n\t}\n\t[backgroundInternalProperty.setNative](value: Background) {\n\t\tif (value && value.image instanceof LinearGradient) {\n\t\t\tthis._applyGradientToTrack(value.image);\n\t\t}\n\t}\n\n\tprivate _applyGradientToTrack(gradient: LinearGradient): void {\n\t\tconst nativeView = this.nativeViewProtected;\n\t\tif (!nativeView) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get dimensions\n\t\tconst density = nativeView.getContext().getResources().getDisplayMetrics().density;\n\t\tconst width = nativeView.getWidth() || 1000;\n\t\tconst trackHeight = Math.round(3 * density); // 3dp track height to match iOS\n\t\tconst cornerRadius = trackHeight / 2;\n\n\t\t// Create colors array from gradient stops\n\t\tconst colors = Array.create('int', gradient.colorStops.length);\n\t\tgradient.colorStops.forEach((stop, index) => {\n\t\t\tcolors[index] = stop.color.android;\n\t\t});\n\n\t\t// Create semi-transparent colors for background\n\t\tconst bgColors = Array.create('int', gradient.colorStops.length);\n\t\tgradient.colorStops.forEach((stop, index) => {\n\t\t\tconst color = stop.color;\n\t\t\tconst alpha = Math.round(color.a * 0.3);\n\t\t\tbgColors[index] = android.graphics.Color.argb(alpha, color.r, color.g, color.b);\n\t\t});\n\n\t\t// Create rounded corner radii\n\t\tconst radii = Array.create('float', 8);\n\t\tfor (let i = 0; i < 8; i++) {\n\t\t\tradii[i] = cornerRadius;\n\t\t}\n\n\t\t// Background track - use GradientDrawable for proper sizing\n\t\tconst bgDrawable = new android.graphics.drawable.GradientDrawable();\n\t\tbgDrawable.setOrientation(android.graphics.drawable.GradientDrawable.Orientation.LEFT_RIGHT);\n\t\tbgDrawable.setColors(bgColors);\n\t\tbgDrawable.setCornerRadius(cornerRadius);\n\t\tbgDrawable.setShape(android.graphics.drawable.GradientDrawable.RECTANGLE);\n\n\t\t// Progress track - use GradientDrawable\n\t\tconst progressDrawable = new android.graphics.drawable.GradientDrawable();\n\t\tprogressDrawable.setOrientation(android.graphics.drawable.GradientDrawable.Orientation.LEFT_RIGHT);\n\t\tprogressDrawable.setColors(colors);\n\t\tprogressDrawable.setCornerRadius(cornerRadius);\n\t\tprogressDrawable.setShape(android.graphics.drawable.GradientDrawable.RECTANGLE);\n\n\t\t// Wrap progress in ClipDrawable for clipping based on progress\n\t\tconst progressClip = new android.graphics.drawable.ClipDrawable(progressDrawable, android.view.Gravity.LEFT, android.graphics.drawable.ClipDrawable.HORIZONTAL);\n\n\t\t// Create LayerDrawable with both layers\n\t\tconst layers = Array.create(android.graphics.drawable.Drawable, 2);\n\t\tlayers[0] = bgDrawable;\n\t\tlayers[1] = progressClip;\n\n\t\tconst layerDrawable = new android.graphics.drawable.LayerDrawable(layers);\n\t\tlayerDrawable.setId(0, android.R.id.background);\n\t\tlayerDrawable.setId(1, android.R.id.progress);\n\n\t\t// Set layer height using setLayerSize (API 23+) or setLayerInset\n\t\t// Use setLayerHeight to constrain the actual drawable height\n\t\tconst thumbHeight = Math.round(20 * density); // Approximate thumb size\n\t\tconst verticalInset = Math.round((thumbHeight - trackHeight) / 2);\n\n\t\tlayerDrawable.setLayerInset(0, 0, verticalInset, 0, verticalInset);\n\t\tlayerDrawable.setLayerInset(1, 0, verticalInset, 0, verticalInset);\n\n\t\t// Apply to slider\n\t\tnativeView.setProgressDrawable(layerDrawable);\n\n\t\t// Disable split track to remove the gap behind thumb\n\t\tnativeView.setSplitTrack(false);\n\n\t\t// Set max height to constrain the SeekBar\n\t\tnativeView.setMaxHeight(thumbHeight);\n\t\tnativeView.setMinHeight(thumbHeight);\n\n\t\t// Force refresh progress\n\t\tconst currentProgress = nativeView.getProgress();\n\t\tnativeView.setProgress(0);\n\t\tnativeView.setProgress(currentProgress);\n\t}\n}\n"]}
@@ -146,8 +146,8 @@ export class Background {
146
146
  return false;
147
147
  }
148
148
  let isImageEqual = false;
149
- if (value1 instanceof LinearGradient && value2 instanceof LinearGradient) {
150
- isImageEqual = LinearGradient.equals(value1, value2);
149
+ if (value1.image instanceof LinearGradient && value2.image instanceof LinearGradient) {
150
+ isImageEqual = LinearGradient.equals(value1.image, value2.image);
151
151
  }
152
152
  else {
153
153
  isImageEqual = value1.image === value2.image;