mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: cleanup
This commit is contained in:
@@ -430,14 +430,6 @@ import * as module_ui_animation_keyframe_animation_core from "@nativescript/core
|
||||
import * as module_ui_animation_keyframe_animation_compat from "tns-core-modules/ui/animation/keyframe-animation";
|
||||
compare("ui/animation/keyframe-animation", module_ui_animation_keyframe_animation_core, module_ui_animation_keyframe_animation_compat);
|
||||
|
||||
import * as module_ui_border_core from "@nativescript/core/ui/border";
|
||||
import * as module_ui_border_compat from "tns-core-modules/ui/border";
|
||||
compare("ui/border", module_ui_border_core, module_ui_border_compat);
|
||||
|
||||
import * as module_ui_border_border_core from "@nativescript/core/ui/border/border";
|
||||
import * as module_ui_border_border_compat from "tns-core-modules/ui/border/border";
|
||||
compare("ui/border/border", module_ui_border_border_core, module_ui_border_border_compat);
|
||||
|
||||
import * as module_ui_bottom_navigation_core from "@nativescript/core/ui/bottom-navigation";
|
||||
import * as module_ui_bottom_navigation_compat from "tns-core-modules/ui/bottom-navigation";
|
||||
compare("ui/bottom-navigation", module_ui_bottom_navigation_core, module_ui_bottom_navigation_compat);
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import * as frame from "tns-core-modules/ui/frame";
|
||||
import { EventData } from "tns-core-modules/ui/frame";
|
||||
import { Button } from "tns-core-modules/ui/button";
|
||||
import { ActionBar } from "tns-core-modules/ui/action-bar";
|
||||
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("ui-tests-app/action-bar/clean");
|
||||
}
|
||||
|
||||
export function onChangeRenderingMode(args: EventData) {
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import * as frame from "tns-core-modules/ui/frame";
|
||||
import { EventData } from "tns-core-modules/ui/frame";
|
||||
import { Button } from "tns-core-modules/ui/button";
|
||||
import { ActionBar } from "tns-core-modules/ui/action-bar";
|
||||
import { EventData, Frame, Button, ActionBar } from "@nativescript/core";
|
||||
|
||||
const iconModes = ["automatic", "alwaysOriginal", "alwaysTemplate", undefined];
|
||||
|
||||
export function navigate() {
|
||||
frame.topmost().navigate("action-bar/clean-page");
|
||||
Frame.topmost().navigate("action-bar/clean-page");
|
||||
}
|
||||
|
||||
export function onChangeRenderingMode(args: EventData) {
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import * as frame from "tns-core-modules/ui/frame";
|
||||
import { EventData } from "tns-core-modules/ui/frame";
|
||||
import { Button } from "tns-core-modules/ui/button";
|
||||
import { ActionBar } from "tns-core-modules/ui/action-bar";
|
||||
import { EventData, Frame, Button, ActionBar } from "@nativescript/core";
|
||||
|
||||
const iconModes = ["automatic", "alwaysOriginal", "alwaysTemplate", undefined];
|
||||
|
||||
export function navigate() {
|
||||
frame.topmost().navigate("action-bar/clean-page");
|
||||
Frame.topmost().navigate("action-bar/clean-page");
|
||||
}
|
||||
|
||||
export function onChangeRenderingMode(args: EventData) {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { EventData } from "tns-core-modules/data/observable";
|
||||
import { EventData, Frame, Button, ActionBar, WrapLayout, Page } from "@nativescript/core";
|
||||
import { SubMainPageViewModel } from "../sub-main-page-view-model";
|
||||
import { WrapLayout } from "tns-core-modules/ui/layouts/wrap-layout";
|
||||
import { Page } from "tns-core-modules/ui/page";
|
||||
|
||||
export function pageLoaded(args: EventData) {
|
||||
const page = <Page>args.object;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ShownModallyData } from "tns-core-modules/ui/page";
|
||||
import { ShownModallyData } from "@nativescript/core";
|
||||
|
||||
let closeCallback: Function;
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
import { ShownModallyData } from "tns-core-modules/ui/page";
|
||||
import { Button } from "tns-core-modules/ui/button";
|
||||
import { Label } from "tns-core-modules/ui/label";
|
||||
import { Page } from "tns-core-modules/ui/page";
|
||||
import { EventData, Page, Button, Label, ShownModallyData } from "@nativescript/core";
|
||||
|
||||
let closeCallback: Function;
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import { EventData } from "tns-core-modules/data/observable";
|
||||
import { Page } from "tns-core-modules/ui/page";
|
||||
import { topmost } from "tns-core-modules/ui/frame";
|
||||
import { EventData, Frame, Page, ActionBar } from "@nativescript/core";
|
||||
|
||||
export function btnClick(args: EventData) {
|
||||
(<Page>args.object).page.showModal("action-bar/modal-page", {
|
||||
@@ -11,5 +9,5 @@ export function btnClick(args: EventData) {
|
||||
}
|
||||
|
||||
export function btnBack(args: EventData) {
|
||||
topmost().goBack();
|
||||
Frame.topmost().goBack();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import { EventData } from "tns-core-modules/data/observable";
|
||||
import { Page } from "tns-core-modules/ui/page";
|
||||
import { topmost } from "tns-core-modules/ui/frame";
|
||||
import { EventData, Frame, Page } from "@nativescript/core";
|
||||
|
||||
export function btnClick(args: EventData) {
|
||||
(<Page>args.object).page.showModal("action-bar/modal-page-hidden-action-bar-page", {
|
||||
@@ -11,5 +9,5 @@ export function btnClick(args: EventData) {
|
||||
}
|
||||
|
||||
export function btnBack(args: EventData) {
|
||||
topmost().goBack();
|
||||
Frame.topmost().goBack();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as frame from "tns-core-modules/ui/frame";
|
||||
import { Frame } from "@nativescript/core";
|
||||
|
||||
export function navigate() {
|
||||
frame.topmost().navigate("action-bar/clean-page");
|
||||
Frame.topmost().navigate("action-bar/clean-page");
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as frame from "tns-core-modules/ui/frame";
|
||||
import { Frame } from "@nativescript/core";
|
||||
|
||||
export function navigate() {
|
||||
frame.topmost().navigate("action-bar/clean-page");
|
||||
Frame.topmost().navigate("action-bar/clean-page");
|
||||
}
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
import * as view from "tns-core-modules/ui/core/view";
|
||||
import { View } from "tns-core-modules/ui/core/view";
|
||||
import * as pages from "tns-core-modules/ui/page";
|
||||
import { Button } from "tns-core-modules/ui/button";
|
||||
import { SegmentedBar, SegmentedBarItem } from "tns-core-modules/ui/segmented-bar";
|
||||
import { Label } from "tns-core-modules/ui/label";
|
||||
import { Animation, AnimationDefinition } from "tns-core-modules/ui/animation";
|
||||
import * as fpsMeter from "tns-core-modules/fps-meter";
|
||||
import { getViewById, View, Page, Button, SegmentedBar, SegmentedBarItem, Label, Animation, AnimationDefinition } from "@nativescript/core";
|
||||
import * as fpsMeter from "@nativescript/core/fps-meter";
|
||||
|
||||
let fpsCallbackId;
|
||||
export function onLoaded(args) {
|
||||
const page = args.object;
|
||||
const fpsLabel = view.getViewById(page, "fps") as Label;
|
||||
const fpsLabel = getViewById(page, "fps") as Label;
|
||||
fpsCallbackId = fpsMeter.addCallback((fps: number, minFps: number) => {
|
||||
fpsLabel.text = `${fps.toFixed(2)}/${minFps.toFixed(2)}`;
|
||||
});
|
||||
@@ -85,13 +79,13 @@ export function getBoxPropertyAnimationData(property: string,
|
||||
|
||||
export function easeAnimate(args) {
|
||||
const clicked = args.object as Button;
|
||||
const page: pages.Page = clicked.page;
|
||||
const select = view.getViewById(page, "select") as SegmentedBar;
|
||||
const page: Page = clicked.page;
|
||||
const select = getViewById(page, "select") as SegmentedBar;
|
||||
const item: SegmentedBarItem = select.items[select.selectedIndex];
|
||||
const animsIn: AnimationDefinition[] = [];
|
||||
const animsOut: AnimationDefinition[] = [];
|
||||
for (let i = 0; i < 100; i++) {
|
||||
const box = view.getViewById(page, "el-" + i) as Label;
|
||||
const box = getViewById(page, "el-" + i) as Label;
|
||||
const prop = getBoxPropertyAnimationData(item.title, clicked.text, box, 32, 24);
|
||||
animsIn.push({
|
||||
[prop.animateKey]: prop.animateValueTo,
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
import * as view from "tns-core-modules/ui/core/view";
|
||||
import * as pages from "tns-core-modules/ui/page";
|
||||
import { Button } from "tns-core-modules/ui/button";
|
||||
import { SegmentedBar, SegmentedBarItem } from "tns-core-modules/ui/segmented-bar";
|
||||
import { Label } from "tns-core-modules/ui/label";
|
||||
import { getViewById, View, Page, Button, SegmentedBar, SegmentedBarItem, Label, Animation, AnimationDefinition } from "@nativescript/core";
|
||||
|
||||
export function easeAnimate(args) {
|
||||
const clicked = args.object as Button;
|
||||
const page: pages.Page = clicked.page;
|
||||
const target = view.getViewById(page, "target") as Label;
|
||||
const select = view.getViewById(page, "select") as SegmentedBar;
|
||||
const page: Page = clicked.page;
|
||||
const target = getViewById(page, "target") as Label;
|
||||
const select = getViewById(page, "select") as SegmentedBar;
|
||||
const item: SegmentedBarItem = select.items[select.selectedIndex];
|
||||
const easeType: string = clicked.text;
|
||||
const extent = 128;
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
import * as view from "tns-core-modules/ui/core/view";
|
||||
import * as pages from "tns-core-modules/ui/page";
|
||||
import * as platform from "tns-core-modules/platform";
|
||||
import { getViewById, View, Page, Button, SegmentedBar, SegmentedBarItem, Label, Animation, AnimationDefinition, Screen, TextView } from "@nativescript/core";
|
||||
// import * as uiUtils from "tns-core-modules/ui/utils";
|
||||
import { Animation } from "tns-core-modules/ui/animation";
|
||||
import { TextView } from "tns-core-modules/ui/text-view";
|
||||
// import { isIOS } from "tns-core-modules/platform";
|
||||
|
||||
let toggle = false;
|
||||
|
||||
export function pageLoaded(args) {
|
||||
const page = args.object;
|
||||
const screenHeight = platform.screen.mainScreen.heightDIPs;
|
||||
const screenHeight = Screen.mainScreen.heightDIPs;
|
||||
const screenYCenter = (screenHeight / 2);
|
||||
page.bindingContext = {
|
||||
screenHeight,
|
||||
@@ -42,9 +38,9 @@ http://spaceipsum.com`
|
||||
}
|
||||
|
||||
export function theFinalFrontier(args) {
|
||||
const clicked = args.object as view.View;
|
||||
const page: pages.Page = clicked.page;
|
||||
const details = view.getViewById(page, "details") as TextView;
|
||||
const clicked = args.object as View;
|
||||
const page: Page = clicked.page;
|
||||
const details = getViewById(page, "details") as TextView;
|
||||
const ctx = page.bindingContext;
|
||||
const detailHeaderHeight: number = ctx.detailsHeight;
|
||||
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
import * as view from "tns-core-modules/ui/core/view";
|
||||
import * as pages from "tns-core-modules/ui/page";
|
||||
import { getViewById, View, Page, Button, SegmentedBar, SegmentedBarItem, Label, Animation, AnimationDefinition, Screen, TextView } from "@nativescript/core";
|
||||
import * as platform from "tns-core-modules/platform";
|
||||
import * as uiUtils from "tns-core-modules/ui/utils";
|
||||
import { Animation } from "tns-core-modules/ui/animation";
|
||||
import { TextView } from "tns-core-modules/ui/text-view";
|
||||
import { isIOS } from "tns-core-modules/platform";
|
||||
|
||||
let toggle = false;
|
||||
|
||||
export function pageLoaded(args) {
|
||||
const page = args.object;
|
||||
const screenHeight = platform.screen.mainScreen.heightDIPs;
|
||||
const screenHeight = Screen.mainScreen.heightDIPs;
|
||||
const screenYCenter = (screenHeight / 2);
|
||||
page.bindingContext = {
|
||||
screenHeight,
|
||||
@@ -42,9 +39,9 @@ http://spaceipsum.com`
|
||||
}
|
||||
|
||||
export function theFinalFrontier(args) {
|
||||
const clicked = args.object as view.View;
|
||||
const page: pages.Page = clicked.page;
|
||||
const details = view.getViewById(page, "details") as TextView;
|
||||
const clicked = args.object as View;
|
||||
const page: Page = clicked.page;
|
||||
const details = getViewById(page, "details") as TextView;
|
||||
const ctx = page.bindingContext;
|
||||
const detailHeaderHeight: number = ctx.detailsHeight;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Label } from "tns-core-modules/ui/label";
|
||||
import { Label } from "@nativescript/core";
|
||||
|
||||
let toggle = false;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as view from "tns-core-modules/ui/core/view";
|
||||
import { View } from "@nativescript/core";
|
||||
|
||||
export function tapLabel(args) {
|
||||
const clicked: view.View = args.object;
|
||||
const clicked: View = args.object;
|
||||
const graffiti = clicked as any;
|
||||
clicked.animate({
|
||||
height: graffiti.toggle ? 64 : 128,
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { EventData } from "tns-core-modules/data/observable";
|
||||
import { SubMainPageViewModel } from "../sub-main-page-view-model";
|
||||
import { WrapLayout } from "tns-core-modules/ui/layouts/wrap-layout";
|
||||
import { Page } from "tns-core-modules/ui/page";
|
||||
import { EventData, WrapLayout, Page, ActionBar } from "@nativescript/core";
|
||||
|
||||
export function pageLoaded(args: EventData) {
|
||||
const page = <Page>args.object;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import * as view from "tns-core-modules/ui/core/view";
|
||||
import * as pages from "tns-core-modules/ui/page";
|
||||
import { View, Page } from "@nativescript/core";
|
||||
|
||||
export function applyTap(args) {
|
||||
var page = <pages.Page>(<view.View>args.object).page;
|
||||
var page = <Page>(<View>args.object).page;
|
||||
var css = "#test-element { " + args.object.tag + " }";
|
||||
page.css = css;
|
||||
}
|
||||
|
||||
export function resetTap(args) {
|
||||
var page = <pages.Page>(<view.View>args.object).page;
|
||||
var page = <Page>(<View>args.object).page;
|
||||
page.css = "";
|
||||
}
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
import { EventData } from "tns-core-modules/data/observable";
|
||||
import { View } from "tns-core-modules/ui/core/view";
|
||||
import { Button } from "tns-core-modules/ui/button";
|
||||
import { Color } from "tns-core-modules/color";
|
||||
import { TextView } from "tns-core-modules/ui/text-view";
|
||||
import { ScrollView } from "tns-core-modules/ui/scroll-view";
|
||||
import { EventData, Frame, Button, ScrollView, TextView, Color, View } from "@nativescript/core";
|
||||
|
||||
let red = new Color("red");
|
||||
let green = new Color("green");
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import { EventData, Observable } from "tns-core-modules/data/observable";
|
||||
import { Page } from "tns-core-modules/ui/page";
|
||||
import * as frame from "tns-core-modules/ui/frame";
|
||||
import { EventData, Page, Observable, Frame } from "@nativescript/core";
|
||||
|
||||
export function navigatingTo(args: EventData) {
|
||||
const page = <Page>args.object;
|
||||
@@ -8,7 +6,7 @@ export function navigatingTo(args: EventData) {
|
||||
}
|
||||
|
||||
export function onNavBtnTap(args) {
|
||||
frame.topmost().goBack();
|
||||
Frame.topmost().goBack();
|
||||
}
|
||||
|
||||
export class TestPage extends Observable {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { EventData } from "tns-core-modules/data/observable";
|
||||
import { SubMainPageViewModel } from "../sub-main-page-view-model";
|
||||
import { WrapLayout } from "tns-core-modules/ui/layouts/wrap-layout";
|
||||
import { Page } from "tns-core-modules/ui/page";
|
||||
import { EventData, Page, WrapLayout } from "@nativescript/core";
|
||||
|
||||
export function pageLoaded(args: EventData) {
|
||||
const page = <Page>args.object;
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import { Label } from "tns-core-modules/ui/label";
|
||||
import { EventData, TextBase } from "tns-core-modules/ui/text-base";
|
||||
import { Page } from "tns-core-modules/ui/page";
|
||||
import { EventData, Page, TextBase, Label } from "@nativescript/core";
|
||||
|
||||
export function foxTap(args: EventData) {
|
||||
let page = <Page>(<any>args.object).page;
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
import { isIOS, isAndroid } from "tns-core-modules/platform";
|
||||
import * as fs from "tns-core-modules/file-system/file-system";
|
||||
import * as utils from "tns-core-modules/utils/utils";
|
||||
import { isIOS, isAndroid, knownFolders, path, Utils } from "@nativescript/core";
|
||||
|
||||
export function openFile() {
|
||||
let directory;
|
||||
if (isIOS) {
|
||||
directory = fs.knownFolders.ios.downloads();
|
||||
directory = knownFolders.ios.downloads();
|
||||
} else if (isAndroid) {
|
||||
directory = android.os.Environment.getExternalStorageDirectory().getAbsolutePath().toString();
|
||||
}
|
||||
|
||||
const filePath = fs.path.join(directory, "Test_File_Open.txt");
|
||||
utils.openFile(filePath);
|
||||
const filePath = path.join(directory, "Test_File_Open.txt");
|
||||
Utils.openFile(filePath);
|
||||
}
|
||||
|
||||
@@ -13,8 +13,7 @@
|
||||
"license": "SEE LICENSE IN <your-license-filename>",
|
||||
"repository": "<fill-your-repository-here>",
|
||||
"dependencies": {
|
||||
"@nativescript/core": "file:../../dist/nativescript-core-7.0.0-rc.6.tgz",
|
||||
"@nativescript/core-widgets": "^7.0.0-rc.0"
|
||||
"@nativescript/core": "file:../../dist/nativescript-core-7.0.0-rc.9.tgz"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@testdeck/mocha": "0.0.6",
|
||||
@@ -29,7 +28,7 @@
|
||||
"mochawesome": "~3.1.2",
|
||||
"nativescript-dev-appium": "next",
|
||||
"@nativescript/webpack": "^2.0.0-alpha.3",
|
||||
"@nativescript/types": "file:../../dist/nativescript-types-7.0.0-rc.0.tgz",
|
||||
"@nativescript/types": "~7.0.0-rc.0",
|
||||
"typescript": "~3.9.0"
|
||||
},
|
||||
"gitHead": "8ab7726d1ee9991706069c1359c552e67ee0d1a4",
|
||||
|
||||
Reference in New Issue
Block a user