diff --git a/apps/automated/src/ui/core/bindable/bindable-tests.ts b/apps/automated/src/ui/core/bindable/bindable-tests.ts index c181c868a..28f87fabe 100644 --- a/apps/automated/src/ui/core/bindable/bindable-tests.ts +++ b/apps/automated/src/ui/core/bindable/bindable-tests.ts @@ -4,7 +4,6 @@ import { BindingOptions } from '@nativescript/core/ui/core/bindable'; import * as TKUnit from '../../../tk-unit'; import * as types from '@nativescript/core/utils/types'; import * as helper from '../../../ui-helper'; -import * as utils from '@nativescript/core/utils/utils'; import * as bindingBuilder from '@nativescript/core/ui/builder/binding-builder'; import * as appModule from '@nativescript/core/application'; import { Trace } from '@nativescript/core'; diff --git a/apps/automated/src/ui/label/label-tests.ts b/apps/automated/src/ui/label/label-tests.ts index 3ad6bafea..fd1be0c5b 100644 --- a/apps/automated/src/ui/label/label-tests.ts +++ b/apps/automated/src/ui/label/label-tests.ts @@ -7,7 +7,7 @@ import * as LabelModule from '@nativescript/core/ui/label'; import * as types from '@nativescript/core/utils/types'; import * as colorModule from '@nativescript/core/color'; -import * as utils from '@nativescript/core/utils/utils'; +import * as utils from '@nativescript/core/utils'; import * as observableModule from '@nativescript/core/data/observable'; import * as bindable from '@nativescript/core/ui/core/bindable'; import { CoreTypes, Span, FormattedString } from '@nativescript/core'; diff --git a/apps/automated/src/ui/layouts/stack-layout-tests.ts b/apps/automated/src/ui/layouts/stack-layout-tests.ts index 67271835b..7e7e6cc1d 100644 --- a/apps/automated/src/ui/layouts/stack-layout-tests.ts +++ b/apps/automated/src/ui/layouts/stack-layout-tests.ts @@ -3,7 +3,7 @@ import { Button } from '@nativescript/core/ui/button'; import * as TKUnit from '../../tk-unit'; import * as helper from '../../ui-helper'; import { CoreTypes } from '@nativescript/core'; -import * as utils from '@nativescript/core/utils/utils'; +import * as utils from '@nativescript/core/utils'; import * as testModule from '../../ui-test'; import * as layoutHelper from './layout-helper'; import * as commonTests from './common-layout-tests'; diff --git a/apps/automated/src/ui/placeholder/placeholder-tests.ts b/apps/automated/src/ui/placeholder/placeholder-tests.ts index 7dde63561..6a66700ad 100644 --- a/apps/automated/src/ui/placeholder/placeholder-tests.ts +++ b/apps/automated/src/ui/placeholder/placeholder-tests.ts @@ -1,7 +1,7 @@ import * as TKUnit from '../../tk-unit'; // >> article-creating-view import { isIOS, isAndroid } from '@nativescript/core/platform'; -import * as utils from '@nativescript/core/utils/utils'; +import * as utils from '@nativescript/core/utils'; import * as helper from '../../ui-helper'; import * as viewModule from '@nativescript/core/ui/core/view'; diff --git a/apps/automated/src/ui/search-bar/search-bar-tests-native.android.ts b/apps/automated/src/ui/search-bar/search-bar-tests-native.android.ts index f54d3a41e..c84f82d2f 100644 --- a/apps/automated/src/ui/search-bar/search-bar-tests-native.android.ts +++ b/apps/automated/src/ui/search-bar/search-bar-tests-native.android.ts @@ -1,6 +1,6 @@ import * as colorModule from '@nativescript/core/color'; import * as searchBarModule from '@nativescript/core/ui/search-bar'; -import * as utils from '@nativescript/core/utils/utils'; +import * as utils from '@nativescript/core/utils'; function getTextView(bar: android.widget.SearchView): android.widget.TextView { if (bar) { diff --git a/apps/automated/src/ui/view/view-tests.ios.ts b/apps/automated/src/ui/view/view-tests.ios.ts index d8e025cd7..495298c81 100644 --- a/apps/automated/src/ui/view/view-tests.ios.ts +++ b/apps/automated/src/ui/view/view-tests.ios.ts @@ -4,7 +4,7 @@ import { GridLayout } from '@nativescript/core/ui/layouts/grid-layout'; import { Color } from '@nativescript/core/color'; import * as helper from '../../ui-helper'; import * as TKUnit from '../../tk-unit'; -import * as utils from '@nativescript/core/utils/utils'; +import * as utils from '@nativescript/core/utils'; export * from './view-tests-common'; diff --git a/apps/automated/src/utils/utils-tests.ts b/apps/automated/src/utils/utils-tests.ts index 1a45b0f5e..af99b603b 100644 --- a/apps/automated/src/utils/utils-tests.ts +++ b/apps/automated/src/utils/utils-tests.ts @@ -1,5 +1,5 @@ import * as TKUnit from '../tk-unit'; -import * as utils from '@nativescript/core/utils/utils'; +import * as utils from '@nativescript/core/utils'; import { isIOS } from '@nativescript/core/platform'; export function test_GC_isDefined() { diff --git a/apps/ui/src/flexbox/flexbox-perf-comparison-page.ts b/apps/ui/src/flexbox/flexbox-perf-comparison-page.ts index 74fb8584f..60885d38d 100644 --- a/apps/ui/src/flexbox/flexbox-perf-comparison-page.ts +++ b/apps/ui/src/flexbox/flexbox-perf-comparison-page.ts @@ -1,5 +1,5 @@ -import { TabView } from '@nativescript/core/ui/tab-view'; -import * as utils from '@nativescript/core/utils/utils'; +import { TabView } from '@nativescript/core'; +import * as utils from '@nativescript/core/utils'; const titles = ['Etiam lacinia', 'Imperdiet ante', 'A interdum', 'Quisque tempus', 'Sodales viverra']; const bodies = [ diff --git a/apps/ui/src/issues/issue-2942-page.ts b/apps/ui/src/issues/issue-2942-page.ts index 9d243d09b..f4f838f8e 100644 --- a/apps/ui/src/issues/issue-2942-page.ts +++ b/apps/ui/src/issues/issue-2942-page.ts @@ -1,5 +1,4 @@ -import { ad } from '@nativescript/core/utils/utils'; -import { isAndroid } from '@nativescript/core/platform'; +import { Utils } from '@nativescript/core'; export function onButtonLoaded(args) { if (args.object.android) { @@ -14,7 +13,5 @@ export function onListViewLoaded(args) { } export function hideKeyboard() { - if (isAndroid) { - ad.dismissSoftInput(); - } + Utils.dismissSoftInput(); } diff --git a/packages/core/file-system/file-system-access.android.ts b/packages/core/file-system/file-system-access.android.ts index b2b159d16..82caafafa 100644 --- a/packages/core/file-system/file-system-access.android.ts +++ b/packages/core/file-system/file-system-access.android.ts @@ -1,6 +1,6 @@ import * as textModule from '../text'; import { getNativeApplication } from '../application'; -import { SDK_VERSION } from '../utils/utils'; +import { SDK_VERSION } from '../utils'; import type { IFileSystemAccess } from './file-system-access'; diff --git a/packages/core/utils/utils-common.ts b/packages/core/utils/common.ts similarity index 100% rename from packages/core/utils/utils-common.ts rename to packages/core/utils/common.ts diff --git a/packages/core/utils/index.android.ts b/packages/core/utils/index.android.ts index 488aea78a..a72b399a2 100644 --- a/packages/core/utils/index.android.ts +++ b/packages/core/utils/index.android.ts @@ -1,12 +1,13 @@ import { ad } from './native-helper'; -import { SDK_VERSION } from '../utils'; import { FileSystemAccess } from '../file-system/file-system-access'; import { Trace } from '../trace'; export { ad, dataDeserialize, dataSerialize, iOSNativeHelper } from './native-helper'; -export * from './utils-common'; +export * from './common'; export { Source } from './debug'; +export const SDK_VERSION = android.os.Build.VERSION.SDK_INT; + const MIN_URI_SHARE_RESTRICTED_APK_VERSION = 24; export function GC() { diff --git a/packages/core/utils/index.ios.ts b/packages/core/utils/index.ios.ts index 5044fbc1b..f0db9e517 100644 --- a/packages/core/utils/index.ios.ts +++ b/packages/core/utils/index.ios.ts @@ -2,9 +2,11 @@ import { iOSNativeHelper } from './native-helper'; import { Trace } from '../trace'; export { dataDeserialize, dataSerialize, iOSNativeHelper } from './native-helper'; -export * from './utils-common'; +export * from './common'; export { Source } from './debug'; +export const SDK_VERSION = parseFloat(UIDevice.currentDevice.systemVersion); + export function openFile(filePath: string): boolean { try { const appPath = iOSNativeHelper.getCurrentAppPath(); diff --git a/packages/core/utils/utils.android.ts b/packages/core/utils/utils.android.ts deleted file mode 100644 index 6c2107e0d..000000000 --- a/packages/core/utils/utils.android.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * A lot of plugins still used utils/utils - * Left here for convenience (over time can eventually remove these) - */ -export * from './index'; - -export const SDK_VERSION = android.os.Build.VERSION.SDK_INT; diff --git a/packages/core/utils/utils.d.ts b/packages/core/utils/utils.d.ts deleted file mode 100644 index ea465c2a3..000000000 --- a/packages/core/utils/utils.d.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './index'; diff --git a/packages/core/utils/utils.ios.ts b/packages/core/utils/utils.ios.ts deleted file mode 100644 index a26304a30..000000000 --- a/packages/core/utils/utils.ios.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * A lot of plugins still used utils/utils - * Left here for convenience (over time can eventually remove these) - */ -export * from './index'; - -export const SDK_VERSION = parseFloat(UIDevice.currentDevice.systemVersion);