mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: cleanup
This commit is contained in:
@@ -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) {
|
||||
(<any>backgroundModule).initImageCache(androidApp.startActivity, (<any>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<T>(func: T): T {
|
||||
return isIOS ? func : undefined;
|
||||
return global.isIOS ? func : undefined;
|
||||
}
|
||||
|
||||
export const test_SettingImageSourceWhenSizedToParentDoesNotRequestLayout = ios(() => {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user