mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
* test(e2e): modal-navigation app webpack support * test(e2e): add modal-navigation app smoke test * chore(e2e): tslint disable next line * chore(e2e): modal-navigation app compilation * refactor(e2e): modal-nabivation app pages * test(e2e): add app root modal frame tests * test(e2e): add app root modal frame background tests * refactor(e2e): app root modal frame tests * test(e2e): add tab root modal frame tests * refactor(e2e): modal frame tests * test(e2e): add modal page tests * docs(e2e): add scenarios * refactor(e2e): modal-navigation app tests * test(e2e): turn on/off "Don't keep activities" * test(e2e): delete no background tests * test(e2e): add modal tab tests * refactor(e2e): quit driver after all tests * refactor(e2e): config files * fix(e2e): tab root tests * refactor(e2e): skip tab root tests until fix app * chore(e2e): config files
62 lines
1.9 KiB
TypeScript
62 lines
1.9 KiB
TypeScript
import * as application from "tns-core-modules/application";
|
|
import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout";
|
|
import { NavigatedData, Page } from "tns-core-modules/ui/page";
|
|
import { View, EventData } from "tns-core-modules/ui/core/view";
|
|
import { Frame } from "tns-core-modules/ui/frame";
|
|
|
|
export function onNavigatingTo(args: NavigatedData) {
|
|
const page = <StackLayout>args.object;
|
|
console.log("home-page onNavigatingTo");
|
|
}
|
|
|
|
export function onNavigatingFrom(args: NavigatedData) {
|
|
console.log("home-page onNavigatingFrom");
|
|
}
|
|
|
|
export function onNavigatedTo(args: NavigatedData) {
|
|
console.log("home-page onNavigatedTo");
|
|
}
|
|
|
|
export function onNavigatedFrom(args: NavigatedData) {
|
|
console.log("home-page onNavigatedFrom");
|
|
}
|
|
|
|
export function onModalFrame(args: EventData) {
|
|
const view = args.object as View;
|
|
|
|
const frame = new Frame();
|
|
frame.navigate("modal/modal-page");
|
|
|
|
view.showModal(frame,
|
|
"context",
|
|
() => console.log("home-page modal frame closed"),
|
|
false);
|
|
}
|
|
|
|
export function onModalPage(args: EventData) {
|
|
const view = args.object as View;
|
|
view.showModal("modal/modal-page",
|
|
{ frameless: true },
|
|
() => console.log("home-page modal page closed"),
|
|
false);
|
|
}
|
|
|
|
export function onModalTabView(args: EventData) {
|
|
const view = args.object as View;
|
|
view.showModal("modal-tab/modal-tab-root",
|
|
{ frameless: true },
|
|
() => console.log("home-page modal tabview closed"),
|
|
false);
|
|
}
|
|
|
|
export function onNavigate(args: EventData) {
|
|
const view = args.object as View;
|
|
const page = view.page as Page;
|
|
page.frame.navigate("second/second-page");
|
|
}
|
|
|
|
export function onRootViewChange() {
|
|
let rootView = application.getRootView();
|
|
rootView instanceof Frame ? application._resetRootView({moduleName: "tab-root"}) : application._resetRootView({moduleName: "app-root"});
|
|
}
|