Include test case for item 4151

This commit is contained in:
SvetoslavTsenov
2017-05-16 17:19:52 +03:00
parent d4e4841b59
commit 2079201006
6 changed files with 37 additions and 16 deletions

View File

@ -7,5 +7,5 @@ export function onShownModally(args: ShownModallyData) {
}
export function onTap() {
closeCallback("sample text");
closeCallback("sample text\n");
}

View File

@ -1,4 +1,7 @@
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"
let closeCallback: Function;
@ -7,5 +10,19 @@ export function onShownModally(args: ShownModallyData) {
}
export function onTap() {
closeCallback("sample text");
closeCallback("sample text\n");
}
export function change(args){
var button:Button =<Button>args.object;
var page:Page =<Page> button.parent;
console.log("---------------------page-------------------------")
console.log(page)
var label:Label = <Label> page.getViewById("label1");
label.text="fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo";
var label2:Label = <Label> page.getViewById("label2");
label2.text="foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo";
}

View File

@ -1,5 +1,8 @@
<Page showingModally="onShownModally">
<StackLayout id="layout" >
<Label backgroundColor="green" id="label1" text="short" textWrap="true" />
<Label backgroundColor="red" id="label2" text="" textWrap="true" />
<Button text="Change text" tap="change" />
<Button text="Close" tap="onTap" />
</StackLayout>
</Page>

View File

@ -4,7 +4,7 @@ import { topmost } from "tns-core-modules/ui/frame";
export function btnClick(args: EventData) {
(<Page>args.object).page.showModal("ui-tests-app/action-bar/modal-page", "", function (arg: string) {
// ...
console.log("Callback args: " + arg);
}, true);
}

View File

@ -5,6 +5,7 @@ import { topmost } from "tns-core-modules/ui/frame";
export function btnClick(args: EventData) {
(<Page>args.object).page.showModal("ui-tests-app/action-bar/modal-page-hidden-action-bar", "", function (arg: string) {
// ...
console.log("Callback args: " + arg);
}, true);
}

View File

@ -1,15 +1,15 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd">
<Page.actionBar>
<ActionBar backgroundColor="green" title="Main View" icon="">
<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>
<button text="Open Modal" tap="btnClick" />
<button text="Go Back" tap="btnBack" />
</StackLayout>
<Page.actionBar>
<ActionBar backgroundColor="green" title="Main View" icon="">
<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>
<button text="Open Modal" tap="btnClick" />
<button text="Go Back" tap="btnBack" />
</StackLayout>
</Page>