Update status bar test page

This commit is contained in:
SvetoslavTsenov
2017-02-09 14:01:45 +02:00
committed by vakrilov
parent c555b5b7e1
commit de2c449bc9
2 changed files with 47 additions and 38 deletions

View File

@ -1,9 +1,11 @@
import { Color } from "color";
import { Page } from "ui/page";
import { View, unsetValue } from "ui/core/view";
import color = require("color");
import page = require("ui/page");
import style = require("ui/styling/style");
import view = require("ui/core/view");
import { unsetValue } from "ui/core/properties";
export function applyTap(args) {
let page = <Page>(<View>args.object).page;
let page = <page.Page>(<view.View>args.object).page;
reset(page);
@ -12,16 +14,16 @@ export function applyTap(args) {
}
export function applyTapOnStyledActionBar(args) {
let page = <Page>(<View>args.object).page;
let page = <page.Page>(<view.View>args.object).page;
reset(page);
page.actionBar.backgroundColor = new Color("#5DFC0A");
page.actionBar.backgroundColor = new color.Color("#5DFC0A");
page.css = "#test-element { " + args.object.tag + " }";
}
export function applyTapWithHiddenActionBar(args) {
let page = <Page>(<View>args.object).page;
let page = <page.Page>(<view.View>args.object).page;
reset(page);
@ -30,7 +32,7 @@ export function applyTapWithHiddenActionBar(args) {
}
export function applyTapWithSpan(args) {
let page = <Page>(<View>args.object).page;
let page = <page.Page>(<view.View>args.object).page;
reset(page);
@ -39,17 +41,17 @@ export function applyTapWithSpan(args) {
}
export function applyTapOnStyledActionBarAndSpan(args) {
let page = <Page>(<View>args.object).page;
let page = <page.Page>(<view.View>args.object).page;
reset(page);
page.backgroundSpanUnderStatusBar = true;
page.actionBar.backgroundColor = new Color("#E0115F");
page.actionBar.backgroundColor = new color.Color("#E0115F");
page.css = "#test-element { " + args.object.tag + " }";
}
export function applyTapWithActionBarHiddenAndSpan(args) {
let page = <Page>(<View>args.object).page;
let page = <page.Page>(<view.View>args.object).page;
reset(page);
@ -58,7 +60,7 @@ export function applyTapWithActionBarHiddenAndSpan(args) {
page.css = "#test-element { " + args.object.tag + " }";
}
function reset(page: Page) {
function reset(page: page.Page) {
page.css = "";
page.actionBarHidden = false;
page.backgroundSpanUnderStatusBar = false;

View File

@ -4,35 +4,42 @@
<ActionBar title="Sample title" />
</Page.actionBar>
<WrapLayout>
<!-- status-bar-style -->
<Button text="11" tap="applyTap" tag="status-bar-style: light;" style.fontSize="8" width="40" height="40" automationText="light;" />
<Button text="12" tap="applyTap" tag="status-bar-style: dark;" style.fontSize="8" width="40" height="40" automationText="dark;" />
<StackLayout padding="10">
<Label text="IOS and Android" fontSize="14"/>
<WrapLayout>
<!-- status-bar-style -->
<Button text="11" tap="applyTap" tag="status-bar-style: light;" style.fontSize="8" width="40" height="40" automationText="light;" />
<Button text="12" tap="applyTap" tag="status-bar-style: dark;" style.fontSize="8" width="40" height="40" automationText="dark;" />
<!-- status-bar-style - action-bar - background -->
<Button text="21" tap="applyTapOnStyledActionBar" tag="status-bar-style: light;" style.fontSize="8" width="40" height="40" automationText="light-abb-ruby" />
<Button text="22" tap="applyTapOnStyledActionBar" tag="status-bar-style: dark;" style.fontSize="8" width="40" height="40" automationText="dark-abb-ruby" />
<!-- status-bar-style - action-bar - hidden -->
<Button text="31" tap="applyTapWithHiddenActionBar" tag="status-bar-style: light;" style.fontSize="8" width="40" height="40" automationText="light-ab-hidden" />
<Button text="32" tap="applyTapWithHiddenActionBar" tag="status-bar-style: dark;" style.fontSize="8" width="40" height="40" automationText="ark-ab-hidden" />
<!-- android-status-bar-background -->
<Button text="41" tap="applyTap" tag="android-status-bar-background: #E0115F;" style.fontSize="8" width="40" height="40" automationText="asbb-blue" />
<!-- status-bar-style - action-bar - background -->
<Button text="21" tap="applyTapOnStyledActionBar" tag="status-bar-style: light;" style.fontSize="8" width="40" height="40" automationText="light-abb-ruby" />
<Button text="22" tap="applyTapOnStyledActionBar" tag="status-bar-style: dark;" style.fontSize="8" width="40" height="40" automationText="dark-abb-ruby" />
<!-- status-bar-style - page - background -->
<Button text="51" tap="applyTap" tag="status-bar-style: light;background-color: #E0115F;" style.fontSize="8" width="40" height="40" automationText="light-bckg-ruby" />
<Button text="52" tap="applyTap" tag="status-bar-style: dark; background-color: #E0115F;" style.fontSize="8" width="40" height="40" automationText="dark-bckg-ruby" />
<!-- status-bar-style - page - background -->
<Button text="51" tap="applyTap" tag="status-bar-style: light;background-color: #E0115F;" style.fontSize="8" width="40" height="40" automationText="light-bckg-ruby" />
<Button text="52" tap="applyTap" tag="status-bar-style: dark; background-color: #E0115F;" style.fontSize="8" width="40" height="40" automationText="dark-bckg-ruby" />
<!-- status-bar-style - page - and - action-bar - background -->
<Button text="61" tap="applyTapOnStyledActionBar" tag="status-bar-style: light;background-color: #E0115F;" style.fontSize="8" width="40" height="40" automationText="light-bckg-yellow-abbckg-ruby" />
<Button text="62" tap="applyTapOnStyledActionBar" tag="status-bar-style: dark; ;background-color: #E0115F;" style.fontSize="8" width="40" height="40" automationText="dark-bckg-yellow-abbckg-ruby" />
<!-- status-bar-style - page - and - action-bar - background -->
<Button text="61" tap="applyTapOnStyledActionBar" tag="status-bar-style: light;background-color: #E0115F;" style.fontSize="8" width="40" height="40" automationText="light-bckg-yellow-abbckg-ruby" />
<Button text="62" tap="applyTapOnStyledActionBar" tag="status-bar-style: dark; ;background-color: #E0115F;" style.fontSize="8" width="40" height="40" automationText="dark-bckg-yellow-abbckg-ruby" />
<!-- status-bar-style - action-bar - hidden - and - backgroundSpanUnderStatusBar -->
<Button text="71" tap="applyTapWithSpan" tag="status-bar-style: light;background-color: yellow" style.fontSize="8" width="40" height="40" automationText="dark-bckg-yellow-bckgsusb-true" />
<Button text="72" tap="applyTapOnStyledActionBarAndSpan" tag="status-bar-style: light;background-color: yellow;" style.fontSize="8" width="40" height="40" automationText="light-bckg-yellow-abbck-ruby-bckgsusb-true" />
<!-- status-bar-style - action-bar - hidden - and - backgroundSpanUnderStatusBar -->
<Button text="71" tap="applyTapWithSpan" tag="status-bar-style: light;background-color: yellow" style.fontSize="8" width="40" height="40" automationText="dark-bckg-yellow-bckgsusb-true" />
<Button text="72" tap="applyTapOnStyledActionBarAndSpan" tag="status-bar-style: light;background-color: yellow;" style.fontSize="8" width="40" height="40" automationText="light-bckg-yellow-abbck-ruby-bckgsusb-true" />
<Button text="73" tap="applyTapWithSpan" tag="status-bar-style: dark;background-color: yellow;" style.fontSize="8" width="40" height="40" automationText="light-ab-hidden-bckgsusb-true" />
<Button text="74" tap="applyTapWithActionBarHiddenAndSpan" tag="status-bar-style: dark;background-color: yellow;" style.fontSize="8" width="40" height="40" automationText="dark-ab-hidden-bckgsusb-true" />
</WrapLayout>
<Button text="73" tap="applyTapWithSpan" tag="status-bar-style: dark;background-color: yellow;" style.fontSize="8" width="40" height="40" automationText="light-ab-hidden-bckgsusb-true" />
<Button text="74" tap="applyTapWithActionBarHiddenAndSpan" tag="status-bar-style: dark;background-color: yellow;" style.fontSize="8" width="40" height="40" automationText="dark-ab-hidden-bckgsusb-true" />
</WrapLayout>
<Label text="Android" fontSize="14" marginTop="10"/>
<WrapLayout>
<!-- status-bar-style - action-bar - hidden -->
<Button text="31" tap="applyTapWithHiddenActionBar" tag="status-bar-style: light;" style.fontSize="8" width="40" height="40" automationText="light-ab-hidden" />
<Button text="32" tap="applyTapWithHiddenActionBar" tag="status-bar-style: dark;" style.fontSize="8" width="40" height="40" automationText="ark-ab-hidden" />
<!-- android-status-bar-background -->
<Button text="41" tap="applyTap" tag="android-status-bar-background: #E0115F;" style.fontSize="8" width="40" height="40" automationText="asbb-ruby" />
</WrapLayout>
</StackLayout>
</Page>