mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Include test for issue 1657 (#3457)
This commit is contained in:
33
apps/app/ui-tests-app/issues/issue-1657-ios.ts
Normal file
33
apps/app/ui-tests-app/issues/issue-1657-ios.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { EventData } from 'data/observable';
|
||||
var frameModule = require("ui/frame");
|
||||
var platform = require("platform");
|
||||
var defaultSpeed = -1;
|
||||
|
||||
export function navigatingTo(args: EventData) {
|
||||
if (platform.device.os === platform.platformNames.ios) {
|
||||
if (defaultSpeed === -1) {
|
||||
defaultSpeed = frameModule.topmost().ios.controller.view.layer.speed;
|
||||
frameModule.topmost().ios.controller.navigationBar.translucent = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function onTap() {
|
||||
frameModule.topmost().navigate({
|
||||
moduleName: "ui-tests-app/issues/sub-page-1657"
|
||||
});
|
||||
}
|
||||
|
||||
export function changeTranslucent() {
|
||||
if (platform.device.os === platform.platformNames.ios) {
|
||||
frameModule.topmost().ios.controller.navigationBar.translucent = frameModule.topmost().ios.controller.navigationBar.translucent === true ? false : true;
|
||||
}
|
||||
}
|
||||
|
||||
export function changeLayerSpeed() {
|
||||
frameModule.topmost().ios.controller.view.layer.speed = 0.01;
|
||||
}
|
||||
|
||||
export function defaultLayerSpeed() {
|
||||
frameModule.topmost().ios.controller.view.layer.speed = defaultSpeed;
|
||||
}
|
||||
19
apps/app/ui-tests-app/issues/issue-1657-ios.xml
Normal file
19
apps/app/ui-tests-app/issues/issue-1657-ios.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="navigatingTo" style="background-color: #30b773; color: #ffffff;">
|
||||
<Page.actionBar>
|
||||
<ActionBar title="Title" icon="" style="background-color: #30b773; color: #ffffff;">
|
||||
<NavigationButton text="Back" icon="" tap="" />
|
||||
<ActionBar.actionItems>
|
||||
<ActionItem icon="" text="Left" tap="" ios.position="left" />
|
||||
<ActionItem icon="" text="Right" tap="" ios.position="right" />
|
||||
</ActionBar.actionItems>
|
||||
</ActionBar>
|
||||
</Page.actionBar>
|
||||
|
||||
<StackLayout>
|
||||
<Label text="Issue 1657" class="title"/>
|
||||
<Button text="go to subPage" tap="onTap"/>
|
||||
<Button text="changeTranslucent" tap="changeTranslucent"/>
|
||||
<Button text="change speed to very slow" tap="changeLayerSpeed"/>
|
||||
<Button text="default layer speed" tap="defaultLayerSpeed"/>
|
||||
</StackLayout>
|
||||
</Page>
|
||||
@@ -21,6 +21,7 @@ export function pageLoaded(args: EventData) {
|
||||
examples.set("3175", "issues/issue-3175");
|
||||
examples.set("3211", "issues/issue-3211");
|
||||
examples.set("1639", "issues/issue-1639");
|
||||
examples.set("1657-ios", "issues/issue-1657-ios");
|
||||
|
||||
let viewModel = new SubMainPageViewModel(wrapLayout, examples);
|
||||
page.bindingContext = viewModel;
|
||||
|
||||
5
apps/app/ui-tests-app/issues/sub-page-1657.xml
Normal file
5
apps/app/ui-tests-app/issues/sub-page-1657.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<Page xmlns="http://www.nativescript.org/tns.xsd" loaded="onLoaded" navigatedTo="onNavigatedTo">
|
||||
<StackLayout>
|
||||
<Label text="SUB PAGE" textWrap="true" />
|
||||
</StackLayout>
|
||||
</Page>
|
||||
Reference in New Issue
Block a user