mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Pages for ui-tests
This commit is contained in:
16
apps/ui-tests-app/pages/text/button.ts
Normal file
16
apps/ui-tests-app/pages/text/button.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import stack = require("ui/layouts/stack-layout");
|
||||
import style = require("ui/styling/style");
|
||||
import view = require("ui/core/view");
|
||||
export function resetStyles(args) {
|
||||
var stackLayout = <stack.StackLayout>args.object.parent;
|
||||
view.eachDescendant(stackLayout, function (v: view.View) {
|
||||
v.style._resetValue(style.fontFamilyProperty);
|
||||
v.style._resetValue(style.fontSizeProperty);
|
||||
v.style._resetValue(style.fontStyleProperty);
|
||||
v.style._resetValue(style.fontWeightProperty);
|
||||
v.style._resetValue(style.fontProperty);
|
||||
v.style._resetValue(style.colorProperty);
|
||||
v.style._resetValue(style.textAlignmentProperty);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
25
apps/ui-tests-app/pages/text/button.xml
Normal file
25
apps/ui-tests-app/pages/text/button.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<Page>
|
||||
<StackLayout>
|
||||
<Button text="RESET" tap="resetStyles"/>
|
||||
|
||||
<Button text="no align" />
|
||||
<Button text="left" style="text-align: left" />
|
||||
<Button text="center" style="text-align: center" />
|
||||
<Button text="right" style="text-align: right" />
|
||||
|
||||
<WrapLayout>
|
||||
<Button text="normal" />
|
||||
<Button text="color" style="color: green"/>
|
||||
<Button text="size" style="font-size: 32" />
|
||||
<Button text="italic" style="font-style: italic" />
|
||||
<Button text="bold" style="font-weight: bold"/>
|
||||
<Button text="bold-italic" style="font-weight: bold; font-style: italic"/>
|
||||
<Button text="serif" style="font-family: serif"/>
|
||||
<Button text="sans-serif" style="font-family: sans-serif"/>
|
||||
<Button text="monospace" style="font-family: monospace"/>
|
||||
<Button text="Times New Roman" style="font-family: Times New Roman"/>
|
||||
<Button text="invalid font" style="font-family: InvalidFont"/>
|
||||
<Button text="all in one" style="font-family: serif; font-weight: bold; font-style: italic; font-size: 32; color: green" />
|
||||
</WrapLayout>
|
||||
</StackLayout>
|
||||
</Page>
|
||||
16
apps/ui-tests-app/pages/text/label.ts
Normal file
16
apps/ui-tests-app/pages/text/label.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import stack = require("ui/layouts/stack-layout");
|
||||
import style = require("ui/styling/style");
|
||||
import view = require("ui/core/view");
|
||||
export function resetStyles(args) {
|
||||
var stackLayout = <stack.StackLayout>args.object.parent;
|
||||
view.eachDescendant(stackLayout, function (v: view.View) {
|
||||
v.style._resetValue(style.fontFamilyProperty);
|
||||
v.style._resetValue(style.fontSizeProperty);
|
||||
v.style._resetValue(style.fontStyleProperty);
|
||||
v.style._resetValue(style.fontWeightProperty);
|
||||
v.style._resetValue(style.fontProperty);
|
||||
v.style._resetValue(style.colorProperty);
|
||||
v.style._resetValue(style.textAlignmentProperty);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
25
apps/ui-tests-app/pages/text/label.xml
Normal file
25
apps/ui-tests-app/pages/text/label.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<Page>
|
||||
<StackLayout>
|
||||
<Button text="RESET" tap="resetStyles"/>
|
||||
|
||||
<Label text="no align" />
|
||||
<Label text="left" style="text-align: left" />
|
||||
<Label text="center" style="text-align: center" />
|
||||
<Label text="right" style="text-align: right" />
|
||||
|
||||
<WrapLayout>
|
||||
<Label text="normal" />
|
||||
<Label text="color" style="color: green"/>
|
||||
<Label text="size" style="font-size: 32" />
|
||||
<Label text="italic" style="font-style: italic" />
|
||||
<Label text="bold" style="font-weight: bold"/>
|
||||
<Label text="bold-italic" style="font-weight: bold; font-style: italic"/>
|
||||
<Label text="serif" style="font-family: serif"/>
|
||||
<Label text="sans-serif" style="font-family: sans-serif"/>
|
||||
<Label text="monospace" style="font-family: monospace"/>
|
||||
<Label text="Times New Roman" style="font-family: Times New Roman"/>
|
||||
<Label text="invalid font" style="font-family: InvalidFont"/>
|
||||
<Label text="all in one" style="font-family: serif; font-weight: bold; font-style: italic; font-size: 32; color: green" />
|
||||
</WrapLayout>
|
||||
</StackLayout>
|
||||
</Page>
|
||||
16
apps/ui-tests-app/pages/text/text-field.ts
Normal file
16
apps/ui-tests-app/pages/text/text-field.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import stack = require("ui/layouts/stack-layout");
|
||||
import style = require("ui/styling/style");
|
||||
import view = require("ui/core/view");
|
||||
export function resetStyles(args) {
|
||||
var stackLayout = <stack.StackLayout>args.object.parent;
|
||||
view.eachDescendant(stackLayout, function (v: view.View) {
|
||||
v.style._resetValue(style.fontFamilyProperty);
|
||||
v.style._resetValue(style.fontSizeProperty);
|
||||
v.style._resetValue(style.fontStyleProperty);
|
||||
v.style._resetValue(style.fontWeightProperty);
|
||||
v.style._resetValue(style.fontProperty);
|
||||
v.style._resetValue(style.colorProperty);
|
||||
v.style._resetValue(style.textAlignmentProperty);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
25
apps/ui-tests-app/pages/text/text-field.xml
Normal file
25
apps/ui-tests-app/pages/text/text-field.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<Page>
|
||||
<StackLayout>
|
||||
<Button text="RESET" tap="resetStyles"/>
|
||||
|
||||
<TextField text="no align" />
|
||||
<TextField text="left" style="text-align: left" />
|
||||
<TextField text="center" style="text-align: center" />
|
||||
<TextField text="right" style="text-align: right" />
|
||||
|
||||
<WrapLayout>
|
||||
<TextField text="normal" />
|
||||
<TextField text="color" style="color: green"/>
|
||||
<TextField text="size" style="font-size: 32" />
|
||||
<TextField text="italic" style="font-style: italic" />
|
||||
<TextField text="bold" style="font-weight: bold"/>
|
||||
<TextField text="bold-italic" style="font-weight: bold; font-style: italic"/>
|
||||
<TextField text="serif" style="font-family: serif"/>
|
||||
<TextField text="sans-serif" style="font-family: sans-serif"/>
|
||||
<TextField text="monospace" style="font-family: monospace"/>
|
||||
<TextField text="Times New Roman" style="font-family: Times New Roman"/>
|
||||
<TextField text="invalid font" style="font-family: InvalidFont"/>
|
||||
<TextField text="all in one" style="font-family: serif; font-weight: bold; font-style: italic; font-size: 32; color: green" />
|
||||
</WrapLayout>
|
||||
</StackLayout>
|
||||
</Page>
|
||||
16
apps/ui-tests-app/pages/text/text-view.ts
Normal file
16
apps/ui-tests-app/pages/text/text-view.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import stack = require("ui/layouts/stack-layout");
|
||||
import style = require("ui/styling/style");
|
||||
import view = require("ui/core/view");
|
||||
export function resetStyles(args) {
|
||||
var stackLayout = <stack.StackLayout>args.object.parent;
|
||||
view.eachDescendant(stackLayout, function (v: view.View) {
|
||||
v.style._resetValue(style.fontFamilyProperty);
|
||||
v.style._resetValue(style.fontSizeProperty);
|
||||
v.style._resetValue(style.fontStyleProperty);
|
||||
v.style._resetValue(style.fontWeightProperty);
|
||||
v.style._resetValue(style.fontProperty);
|
||||
v.style._resetValue(style.colorProperty);
|
||||
v.style._resetValue(style.textAlignmentProperty);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
25
apps/ui-tests-app/pages/text/text-view.xml
Normal file
25
apps/ui-tests-app/pages/text/text-view.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<Page>
|
||||
<StackLayout>
|
||||
<Button text="RESET" tap="resetStyles"/>
|
||||
|
||||
<TextView text="no align" />
|
||||
<TextView text="left" style="text-align: left" />
|
||||
<TextView text="center" style="text-align: center" />
|
||||
<TextView text="right" style="text-align: right" />
|
||||
|
||||
<WrapLayout>
|
||||
<TextView text="normal" />
|
||||
<TextView text="color" style="color: green"/>
|
||||
<TextView text="size" style="font-size: 32" />
|
||||
<TextView text="italic" style="font-style: italic" />
|
||||
<TextView text="bold" style="font-weight: bold"/>
|
||||
<TextView text="bold-italic" style="font-weight: bold; font-style: italic"/>
|
||||
<TextView text="serif" style="font-family: serif"/>
|
||||
<TextView text="sans-serif" style="font-family: sans-serif"/>
|
||||
<TextView text="monospace" style="font-family: monospace"/>
|
||||
<TextView text="Times New Roman" style="font-family: Times New Roman"/>
|
||||
<TextView text="invalid font" style="font-family: InvalidFont"/>
|
||||
<TextView text="all in one" style="font-family: serif; font-weight: bold; font-style: italic; font-size: 32; color: green" />
|
||||
</WrapLayout>
|
||||
</StackLayout>
|
||||
</Page>
|
||||
Reference in New Issue
Block a user