diff --git a/apps/automated/app/ui/image/image-tests.ts b/apps/automated/app/ui/image/image-tests.ts index 1f5072df5..6ac93c301 100644 --- a/apps/automated/app/ui/image/image-tests.ts +++ b/apps/automated/app/ui/image/image-tests.ts @@ -1,7 +1,6 @@ import { Image } from '@nativescript/core/ui/image'; import { StackLayout } from '@nativescript/core/ui/layouts/stack-layout'; import { GridLayout } from '@nativescript/core/ui/layouts/grid-layout'; -import { isIOS, isAndroid } from '@nativescript/core/platform'; import { PropertyChangeData } from '@nativescript/core'; import * as utils from '@nativescript/core/utils'; import * as TKUnit from '../../tk-unit'; @@ -24,7 +23,7 @@ export function test_recycling() { helper.nativeView_recycling_test(() => new Image()); } -if (isAndroid) { +if (global.isAndroid) { (backgroundModule).initImageCache(androidApp.startActivity, (backgroundModule).CacheMode.memory); // use memory cache only. } @@ -64,7 +63,7 @@ function runImageTestSync(image: ImageModule.Image, src: string) { image.src = src; - let imageSourceAvailable = isIOS ? !!image.imageSource : true; + let imageSourceAvailable = global.isIOS ? !!image.imageSource : true; TKUnit.assertFalse(image.isLoading, 'Image.isLoading should be false.'); TKUnit.assertTrue(imageSourceAvailable, 'imageSource should be set.'); } @@ -77,7 +76,7 @@ function runImageTestAsync(image: ImageModule.Image, src: string, done: (e: any) image.off(IMAGE_LOADED_EVENT, handler); try { - let imageSourceAvailable = isIOS ? !!image.imageSource : true; + let imageSourceAvailable = global.isIOS ? !!image.imageSource : true; TKUnit.assertFalse(image.isLoading, 'Image.isLoading should be false.'); TKUnit.assertTrue(imageSourceAvailable, 'imageSource should be set.'); done(null); @@ -254,7 +253,7 @@ export const test_SettingStretch_none = function () { }; function ios(func: T): T { - return isIOS ? func : undefined; + return global.isIOS ? func : undefined; } export const test_SettingImageSourceWhenSizedToParentDoesNotRequestLayout = ios(() => { diff --git a/apps/ui/app/action-bar/font-icons-page.ts b/apps/ui/app/action-bar/font-icons-page.ts index b3b00aeab..b3c57edc6 100644 --- a/apps/ui/app/action-bar/font-icons-page.ts +++ b/apps/ui/app/action-bar/font-icons-page.ts @@ -3,7 +3,7 @@ import { Frame, EventData, Button, ActionBar } from '@nativescript/core'; const iconModes = ['automatic', 'alwaysOriginal', 'alwaysTemplate', undefined]; export function navigate(args) { - Frame.topmost().navigate('ui-tests-app/action-bar/clean'); + Frame.topmost().navigate('action-bar/clean-page'); } export function onChangeRenderingMode(args: EventData) { diff --git a/apps/ui/app/events/gestures-page.ts b/apps/ui/app/events/gestures-page.ts index d47ddcfbe..b8077b437 100644 --- a/apps/ui/app/events/gestures-page.ts +++ b/apps/ui/app/events/gestures-page.ts @@ -1,14 +1,9 @@ -import { GestureEventData, RotationGestureEventData, GestureTypes, SwipeGestureEventData, PanGestureEventData, PinchGestureEventData, GestureStateTypes } from '@nativescript/core/ui/gestures'; -import { Button } from '@nativescript/core/ui/button'; -import { Label } from '@nativescript/core/ui/label'; -import { Page } from '@nativescript/core/ui/page'; -import { StackLayout } from '@nativescript/core/ui/layouts/stack-layout'; -import { screen, isAndroid } from '@nativescript/core/platform'; +import { Screen, StackLayout, Page, Label, Button, GestureEventData, RotationGestureEventData, GestureTypes, SwipeGestureEventData, PanGestureEventData, PinchGestureEventData, GestureStateTypes } from '@nativescript/core'; export function createPage() { const stack = new StackLayout(); var stopButton = new Button(); - if (isAndroid) { + if (global.isAndroid) { stopButton.height = 30; stopButton.fontSize = 8; } @@ -16,7 +11,7 @@ export function createPage() { stopButton.automationText = 'stopGesturesDetecting'; stack.addChild(stopButton); - const labelHeight = Math.round(screen.mainScreen.heightPixels / (10 * screen.mainScreen.scale)); + const labelHeight = Math.round(Screen.mainScreen.heightPixels / (10 * Screen.mainScreen.scale)); const tapLabel = createLabel('Tap here', labelHeight); stack.addChild(tapLabel); diff --git a/packages/core/ui/index.ts b/packages/core/ui/index.ts index 74d06f856..19d35c64f 100644 --- a/packages/core/ui/index.ts +++ b/packages/core/ui/index.ts @@ -21,16 +21,16 @@ export { addWeakEventListener, removeWeakEventListener } from './core/weak-event export { DatePicker } from './date-picker'; // No need go export dialogs, they are already export exported globally -export { action, alert, confirm, login, prompt, getCurrentPage, Dialogs } from './dialogs'; -export type { DialogStrings, DialogOptions, CancelableOptions, AlertOptions, PromptResult, PromptOptions, ActionOptions, ConfirmOptions, LoginResult, LoginOptions, inputType, capitalizationType } from './dialogs'; +export { action, alert, confirm, login, prompt, getCurrentPage, Dialogs, inputType, capitalizationType } from './dialogs'; +export type { DialogStrings, DialogOptions, CancelableOptions, AlertOptions, PromptResult, PromptOptions, ActionOptions, ConfirmOptions, LoginResult, LoginOptions } from './dialogs'; export * from './editable-text-base'; export { Enums } from './enums'; export { Frame, setActivityCallbacks } from './frame'; export type { NavigationEntry, NavigationContext, NavigationTransition, BackstackEntry, ViewEntry, AndroidActivityCallbacks } from './frame'; -export { GesturesObserver, TouchAction } from './gestures'; -export type { GestureEventData, GestureEventDataWithState, GestureStateTypes, GestureTypes, TapGestureEventData, PanGestureEventData, PinchGestureEventData, RotationGestureEventData, SwipeDirection, SwipeGestureEventData, TouchGestureEventData } from './gestures'; +export { GesturesObserver, TouchAction, GestureTypes, GestureStateTypes, SwipeDirection } from './gestures'; +export type { GestureEventData, GestureEventDataWithState, TapGestureEventData, PanGestureEventData, PinchGestureEventData, RotationGestureEventData, SwipeGestureEventData, TouchGestureEventData } from './gestures'; export { HtmlView } from './html-view'; export { Image } from './image'; diff --git a/packages/core/ui/styling/background.ios.ts b/packages/core/ui/styling/background.ios.ts index 6f45eb2b8..4078cff12 100644 --- a/packages/core/ui/styling/background.ios.ts +++ b/packages/core/ui/styling/background.ios.ts @@ -36,6 +36,10 @@ interface Rect { const clearCGColor = UIColor.clearColor.CGColor; const symbolUrl = Symbol('backgroundImageUrl'); +export enum CacheMode { + none, +} + export module ios { export function createBackgroundUIColor(view: View, callback: (uiColor: UIColor) => void, flip?: boolean): void { const background = view.style.backgroundInternal;