test: added missing page (#8493)

* test: added missing page

* fix: use strings instead of Visiblity
This commit is contained in:
Vasil Trifonov
2020-04-03 17:27:37 +03:00
committed by GitHub
parent ad9daa825f
commit da80cd5e1a
2 changed files with 46 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
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";
export function foxTap(args: EventData) {
let page = <Page>(<any>args.object).page;
let foxTapped = page.getViewById<Label>("foxTapped");
foxTapped.visibility = "visible";
setTimeout(() => {
foxTapped.visibility = "hidden";
}, 1000);
console.log("foxTap");
}
export function dogTap(args: EventData) {
let page = <Page>(<any>args.object).page;
let dogTapped = page.getViewById<Label>("dogTapped");
dogTapped.visibility = "visible";
setTimeout(() => {
dogTapped.visibility = "hidden";
}, 1000);
console.log("dogTap");
}

View File

@@ -0,0 +1,19 @@
<Page>
<StackLayout style="font-size: 50">
<Label automationText="formattedText" id="formattedText" textWrap="true" style="text-transform: capitalize;">
<Label.formattedText>
<FormattedString>
<FormattedString.spans>
<Span text="The quick brown " style="font-weight: bold; color: green;" />
<Span text="fox" style="font-weight: italic; color: green;" linkTap="foxTap"/>
<Span text=" jumps over the lazy " style="font-weight: bold; color: red;" />
<Span text="dog" style="font-weight: bold; color: blue;" linkTap="dogTap"/>
<Span text="." style="font-weight: bold; color: green;" />
</FormattedString.spans>
</FormattedString>
</Label.formattedText>
</Label>
<Label id="foxTapped" text="Fox tapped" visibility="hidden" color="green"/>
<Label id="dogTapped" text="Dog tapped" visibility="hidden" color="blue"/>
</StackLayout>
</Page>