mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
Update ui-tests-app
This commit is contained in:
@ -205,6 +205,9 @@
|
||||
<Content Include="apps\ui-tests-app\action-bar\system-icons.xml">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Content Include="apps\ui-tests-app\css\decoration-transform-formattedtext.xml" />
|
||||
<Content Include="apps\ui-tests-app\css\text-decoration.xml" />
|
||||
<Content Include="apps\ui-tests-app\css\text-transform.xml" />
|
||||
<Content Include="apps\ui-tests-app\css\white-space.xml">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
@ -276,6 +279,7 @@
|
||||
<DependentUpon>color.xml</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="apps\ui-tests-app\css\text-decoration.ts" />
|
||||
<TypeScriptCompile Include="apps\ui-tests-app\css\text-transform.ts" />
|
||||
<TypeScriptCompile Include="apps\ui-tests-app\css\white-space.ts" />
|
||||
<TypeScriptCompile Include="apps\ui-tests-app\html-view\html-view.ts">
|
||||
<DependentUpon>html-view.xml</DependentUpon>
|
||||
|
@ -1,27 +1,53 @@
|
||||
<Page>
|
||||
<StackLayout>
|
||||
<Label text="textText" style="text-transform: uppercase; text-decoration: underline line-through;" />
|
||||
|
||||
<Label text="labelLabel" style="text-transform: uppercase; text-decoration: underline line-through;" />
|
||||
<Label style="text-transform: uppercase; text-decoration: underline line-through;">
|
||||
<Label.formattedText>
|
||||
<FormattedString>
|
||||
<FormattedString.spans>
|
||||
<Span text="text" fontAttributes="Bold" foregroundColor="#ff0000" />
|
||||
<Span text="Text" fontAttributes="Italic" foregroundColor="#00ff00" />
|
||||
<Span text="label" fontAttributes="Bold" foregroundColor="#0000ff" />
|
||||
<Span text="Label" fontAttributes="Italic" foregroundColor="#00ff00" />
|
||||
</FormattedString.spans>
|
||||
</FormattedString>
|
||||
</Label.formattedText>
|
||||
</Label>
|
||||
|
||||
<Button text="textText" style="text-transform: uppercase; text-decoration: underline line-through;" />
|
||||
<Button text="buttonButton" style="text-transform: uppercase; text-decoration: underline line-through;" />
|
||||
<Button style="text-transform: uppercase; text-decoration: underline line-through;">
|
||||
<Button.formattedText>
|
||||
<FormattedString>
|
||||
<FormattedString.spans>
|
||||
<Span text="text" fontAttributes="Bold" foregroundColor="#ff0000" />
|
||||
<Span text="Text" fontAttributes="Italic" foregroundColor="#00ff00" />
|
||||
<Span text="button" fontAttributes="Bold" foregroundColor="#0000ff" />
|
||||
<Span text="Button" fontAttributes="Italic" foregroundColor="#00ff00" />
|
||||
</FormattedString.spans>
|
||||
</FormattedString>
|
||||
</Button.formattedText>
|
||||
</Button>
|
||||
|
||||
<TextField text="textField" style="text-transform: uppercase; text-decoration: underline line-through;" />
|
||||
<TextField style="text-transform: uppercase; text-decoration: underline line-through;">
|
||||
<TextField.formattedText>
|
||||
<FormattedString>
|
||||
<FormattedString.spans>
|
||||
<Span text="text" fontAttributes="Bold" foregroundColor="#0000ff" />
|
||||
<Span text="Field" fontAttributes="Italic" foregroundColor="#00ff00" />
|
||||
</FormattedString.spans>
|
||||
</FormattedString>
|
||||
</TextField.formattedText>
|
||||
</TextField>
|
||||
|
||||
<TextView text="textView" style="text-transform: uppercase; text-decoration: underline line-through;" />
|
||||
<TextView style="text-transform: uppercase; text-decoration: underline line-through;">
|
||||
<TextView.formattedText>
|
||||
<FormattedString>
|
||||
<FormattedString.spans>
|
||||
<Span text="text" fontAttributes="Bold" foregroundColor="#0000ff" />
|
||||
<Span text="View" fontAttributes="Italic" foregroundColor="#00ff00" />
|
||||
</FormattedString.spans>
|
||||
</FormattedString>
|
||||
</TextView.formattedText>
|
||||
</TextView>
|
||||
|
||||
</StackLayout>
|
||||
</Page>
|
@ -1,18 +1,41 @@
|
||||
import view = require("ui/core/view");
|
||||
import observable = require("data/observable");
|
||||
import label = require("ui/label");
|
||||
import button = require("ui/button");
|
||||
import textField = require("ui/text-field");
|
||||
import textView = require("ui/text-view");
|
||||
|
||||
export function butonTap(args) {
|
||||
var btn = <view.View>args.object;
|
||||
var lbl = <label.Label>btn.parent.getViewById("Label1");
|
||||
var btnChange = <view.View>args.object;
|
||||
var lbl = <label.Label>btnChange.parent.getViewById("Label");
|
||||
var btn = <button.Button>btnChange.parent.getViewById("Button");
|
||||
var textField = <textField.TextField>btnChange.parent.getViewById("TextField");
|
||||
var textView = <textView.TextView>btnChange.parent.getViewById("TextView");
|
||||
|
||||
if (lbl.style.textDecoration === "underline") {
|
||||
if (lbl.style.textDecoration === "none") {
|
||||
lbl.style.textDecoration = "underline";
|
||||
btn.style.textDecoration = "underline";
|
||||
textField.style.textDecoration = "underline";
|
||||
textView.style.textDecoration = "underline";
|
||||
} else if (lbl.style.textDecoration === "underline") {
|
||||
lbl.style.textDecoration = "line-through";
|
||||
btn.style.textDecoration = "line-through";
|
||||
textField.style.textDecoration = "line-through";
|
||||
textView.style.textDecoration = "line-through";
|
||||
} else if (lbl.style.textDecoration === "line-through") {
|
||||
lbl.style.textDecoration = "line-through underline";
|
||||
btn.style.textDecoration = "line-through underline";
|
||||
textField.style.textDecoration = "line-through underline";
|
||||
textView.style.textDecoration = "line-through underline";
|
||||
} else if (lbl.style.textDecoration === "line-through underline") {
|
||||
lbl.style.textDecoration = "line-through underline none";
|
||||
btn.style.textDecoration = "line-through underline none";
|
||||
textField.style.textDecoration = "line-through underline none";
|
||||
textView.style.textDecoration = "line-through underline none";
|
||||
} else if (lbl.style.textDecoration === "line-through underline none") {
|
||||
lbl.style.textDecoration = "none";
|
||||
} else if (lbl.style.textDecoration === "none") {
|
||||
lbl.style.textDecoration = "underline";
|
||||
btn.style.textDecoration = "none";
|
||||
textField.style.textDecoration = "none";
|
||||
textView.style.textDecoration = "none";
|
||||
}
|
||||
}
|
@ -1,32 +1,35 @@
|
||||
<Page >
|
||||
<ScrollView>
|
||||
<StackLayout>
|
||||
<Button text="Change" tap="butonTap" />
|
||||
<Label id="Label1" text="Text" style.textDecoration="underline" />
|
||||
<StackLayout>
|
||||
<Button id="Change" text="Change" tap="butonTap" />
|
||||
<Label id="Label" text="Label" style.textDecoration="none" />
|
||||
<Button id="Button" text="Button" style.textDecoration="none" />
|
||||
<TextField id="TextField" text="TextField" style.textDecoration="none" />
|
||||
<TextView id="TextView" text="TextView" style.textDecoration="none" />
|
||||
|
||||
<Label text="Label" style="text-decoration:none" />
|
||||
<Label text="Label" style="text-decoration:underline" />
|
||||
<Label text="Label" style="text-decoration:line-through" />
|
||||
<Label text="Label" style="text-decoration:line-through underline" />
|
||||
<Label text="Label" style="text-decoration:line-through underline none" />
|
||||
<!--
|
||||
<Label text="Label" style="text-decoration:none" />
|
||||
<Label text="Label" style="text-decoration:underline" />
|
||||
<Label text="Label" style="text-decoration:line-through" />
|
||||
<Label text="Label" style="text-decoration:line-through underline" />
|
||||
<Label text="Label" style="text-decoration:line-through underline none" />
|
||||
|
||||
<TextField text="TextField" style="text-decoration:none" />
|
||||
<TextField text="TextField" style="text-decoration:underline" />
|
||||
<TextField text="TextField" style="text-decoration:line-through" />
|
||||
<TextField text="TextField" style="text-decoration:underline line-through" />
|
||||
<TextField text="TextField" style="text-decoration:underline line-through none" />
|
||||
<TextField text="TextField" style="text-decoration:none" />
|
||||
<TextField text="TextField" style="text-decoration:underline" />
|
||||
<TextField text="TextField" style="text-decoration:line-through" />
|
||||
<TextField text="TextField" style="text-decoration:underline line-through" />
|
||||
<TextField text="TextField" style="text-decoration:underline line-through none" />
|
||||
|
||||
<TextView text="TextView" style="text-decoration:none" />
|
||||
<TextView text="TextView" style="text-decoration:underline" />
|
||||
<TextView text="TextView" style="text-decoration:line-through" />
|
||||
<TextView text="TextView" style="text-decoration:line-through underline" />
|
||||
<TextView text="TextView" style="text-decoration:line-through underline none" />
|
||||
<TextView text="TextView" style="text-decoration:none" />
|
||||
<TextView text="TextView" style="text-decoration:underline" />
|
||||
<TextView text="TextView" style="text-decoration:line-through" />
|
||||
<TextView text="TextView" style="text-decoration:line-through underline" />
|
||||
<TextView text="TextView" style="text-decoration:line-through underline none" />
|
||||
|
||||
<Button text="Button" style="text-decoration:none" />
|
||||
<Button text="Button" style="text-decoration:underline" />
|
||||
<Button text="Button" style="text-decoration:line-through" />
|
||||
<Button text="Button" style="text-decoration:underline line-through" />
|
||||
<Button text="Button" style="text-decoration:underline line-through none" />
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
<Button text="Button" style="text-decoration:none" />
|
||||
<Button text="Button" style="text-decoration:underline" />
|
||||
<Button text="Button" style="text-decoration:line-through" />
|
||||
<Button text="Button" style="text-decoration:underline line-through" />
|
||||
<Button text="Button" style="text-decoration:underline line-through none" />
|
||||
-->
|
||||
</StackLayout>
|
||||
</Page>
|
@ -1,18 +1,51 @@
|
||||
import view = require("ui/core/view");
|
||||
import observable = require("data/observable");
|
||||
import label = require("ui/label");
|
||||
import button = require("ui/button");
|
||||
import textField = require("ui/text-field");
|
||||
import textView = require("ui/text-view");
|
||||
|
||||
export function butonTap(args) {
|
||||
var btn = <view.View>args.object;
|
||||
var lbl = <label.Label>btn.parent.getViewById("Label1");
|
||||
var btnChange = <view.View>args.object;
|
||||
var lbl = <label.Label>btnChange.parent.getViewById("Label");
|
||||
var btn = <button.Button>btnChange.parent.getViewById("Button");
|
||||
var textField = <textField.TextField>btnChange.parent.getViewById("TextField");
|
||||
var textView = <textView.TextView>btnChange.parent.getViewById("TextView");
|
||||
|
||||
if (lbl.style.textTransform === "none") {
|
||||
lbl.style.textTransform = "uppercase";
|
||||
} else if (lbl.style.textTransform === "uppercase") {
|
||||
lbl.style.textTransform = "lowercase";
|
||||
} else if (lbl.style.textTransform === "lowercase") {
|
||||
lbl.style.textTransform = "capitalize";
|
||||
btn.style.textTransform = "capitalize";
|
||||
textField.style.textTransform = "capitalize";
|
||||
textView.style.textTransform = "capitalize";
|
||||
} else if (lbl.style.textTransform === "capitalize") {
|
||||
lbl.style.textTransform = "uppercase";
|
||||
btn.style.textTransform = "uppercase";
|
||||
textField.style.textTransform = "uppercase";
|
||||
textView.style.textTransform = "uppercase";
|
||||
} else if (lbl.style.textTransform === "uppercase" && lbl.style.textDecoration !== "line-through underline") {
|
||||
lbl.style.textTransform = "lowercase";
|
||||
btn.style.textTransform = "lowercase";
|
||||
textField.style.textTransform = "lowercase";
|
||||
textView.style.textTransform = "lowercase";
|
||||
} else if (lbl.style.textTransform === "lowercase") {
|
||||
// lbl.style.textTransform = "uppercase";
|
||||
// btn.style.textTransform = "uppercase";
|
||||
// textField.style.textTransform = "uppercase";
|
||||
// textView.style.textTransform = "uppercase";
|
||||
|
||||
// lbl.style.textDecoration = "line-through underline";
|
||||
// btn.style.textDecoration = "line-through underline";
|
||||
// textField.style.textDecoration = "line-through underline";
|
||||
// textView.style.textDecoration = "line-through underline";
|
||||
//} else if (lbl.style.textTransform === "uppercase" && lbl.style.textDecoration === "line-through underline") {
|
||||
lbl.style.textTransform = "none";
|
||||
btn.style.textTransform = "none";
|
||||
textField.style.textTransform = "none";
|
||||
textView.style.textTransform = "none";
|
||||
|
||||
lbl.style.textDecoration = "none";
|
||||
btn.style.textDecoration = "none";
|
||||
textField.style.textDecoration = "none";
|
||||
textView.style.textDecoration = "none";
|
||||
}
|
||||
}
|
@ -1,54 +1,35 @@
|
||||
<Page >
|
||||
<ScrollView>
|
||||
<StackLayout>
|
||||
<Button text="Change" tap="butonTap" />
|
||||
<Label id="Label1" text="text Text" style="text-transform:none" />
|
||||
<StackLayout>
|
||||
<Button id="Change" text="Change" tap="butonTap" />
|
||||
<Label id="Label" text="label Label" style.textTransform="none" />
|
||||
<Button id="Button" text="button Button" style.textTransform="none" />
|
||||
<TextField id="TextField" text="textField textField" style.textTransform="none" />
|
||||
<TextView id="TextView" text="textView textView" style.textTransform="none" />
|
||||
|
||||
<Label text="label label" style="text-transform:none" />
|
||||
<Label text="label label" style="text-transform:capitalize" />
|
||||
<Label text="label label" style="text-transform:uppercase" />
|
||||
<Label text="label label" style="text-transform:lowercase" />
|
||||
<!--
|
||||
<Label text="label label" style="text-transform:none" />
|
||||
<Label text="label label" style="text-transform:capitalize" />
|
||||
<Label text="label label" style="text-transform:uppercase" />
|
||||
<Label text="label label" style="text-transform:lowercase" />
|
||||
|
||||
<TextField text="textField textField" style="text-transform:none" />
|
||||
<TextField text="textField textField" style="text-transform:capitalize" />
|
||||
<TextField text="textField textField" style="text-transform:uppercase;" />
|
||||
<TextField text="textField textField" style="text-transform:lowercase" />
|
||||
<TextField text="textField textField" style="text-transform:uppercase; text-decoration:underline;" />
|
||||
<TextField text="textField textField" style="text-transform:none" />
|
||||
<TextField text="textField textField" style="text-transform:capitalize" />
|
||||
<TextField text="textField textField" style="text-transform:uppercase;" />
|
||||
<TextField text="textField textField" style="text-transform:lowercase" />
|
||||
<TextField text="textField textField" style="text-transform:uppercase; text-decoration:underline;" />
|
||||
|
||||
<TextView text="textView textView" style="text-transform:none" />
|
||||
<TextView text="textView textView" style="text-transform:capitalize" />
|
||||
<TextView text="textView textView" style="text-transform:uppercase" />
|
||||
<TextView text="textView textView" style="text-transform:lowercase" />
|
||||
<TextView text="textView textView" style="text-transform:uppercase; text-decoration:underline;" />
|
||||
<TextView text="textView textView" style="text-transform:none" />
|
||||
<TextView text="textView textView" style="text-transform:capitalize" />
|
||||
<TextView text="textView textView" style="text-transform:uppercase" />
|
||||
<TextView text="textView textView" style="text-transform:lowercase" />
|
||||
<TextView text="textView textView" style="text-transform:uppercase; text-decoration:underline;" />
|
||||
|
||||
<Button text="button Button" style="text-transform:none" />
|
||||
<Button text="button Button" style="text-transform:capitalize" />
|
||||
<Button text="button Button" style="text-transform:uppercase" />
|
||||
<Button text="button Button" style="text-transform:lowercase" />
|
||||
<Button text="button Button" style="text-transform:uppercase; text-decoration:underline;" />
|
||||
<Button text="button Button" style="text-transform:none" />
|
||||
<Button text="button Button" style="text-transform:capitalize" />
|
||||
<Button text="button Button" style="text-transform:uppercase" />
|
||||
<Button text="button Button" style="text-transform:lowercase" />
|
||||
<Button text="button Button" style="text-transform:uppercase; text-decoration:underline;" />
|
||||
-->
|
||||
|
||||
<Label style="text-transform: uppercase; text-decoration: underline line-through;">
|
||||
<Label.formattedText>
|
||||
<FormattedString>
|
||||
<FormattedString.spans>
|
||||
<Span text="text" fontAttributes="Bold" foregroundColor="#ff0000" />
|
||||
<Span text="Text" fontAttributes="Italic" foregroundColor="#00ff00" />
|
||||
</FormattedString.spans>
|
||||
</FormattedString>
|
||||
</Label.formattedText>
|
||||
</Label>
|
||||
|
||||
<Button style="text-transform: uppercase; text-decoration: underline line-through;">
|
||||
<Button.formattedText>
|
||||
<FormattedString>
|
||||
<FormattedString.spans>
|
||||
<Span text="text" fontAttributes="Bold" foregroundColor="#ff0000" />
|
||||
<Span text="Text" fontAttributes="Italic" foregroundColor="#00ff00" />
|
||||
</FormattedString.spans>
|
||||
</FormattedString>
|
||||
</Button.formattedText>
|
||||
</Button>
|
||||
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
</StackLayout>
|
||||
</Page>
|
@ -1,14 +1,26 @@
|
||||
import view = require("ui/core/view");
|
||||
import observable = require("data/observable");
|
||||
import label = require("ui/label");
|
||||
import button = require("ui/button");
|
||||
import textField = require("ui/text-field");
|
||||
import textView = require("ui/text-view");
|
||||
|
||||
export function butonTap(args: observable.EventData) {
|
||||
var btn = <view.View>args.object;
|
||||
var lbl = <label.Label>btn.parent.getViewById("Label1");
|
||||
var btnChange = <view.View>args.object;
|
||||
var lbl = <label.Label>btnChange.parent.getViewById("Label");
|
||||
var btn = <button.Button>btnChange.parent.getViewById("Button");
|
||||
var textField = <textField.TextField>btnChange.parent.getViewById("TextField");
|
||||
var textView = <textView.TextView>btnChange.parent.getViewById("TextView");
|
||||
|
||||
if (lbl.style.whiteSpace === "normal") {
|
||||
lbl.style.whiteSpace = "nowrap";
|
||||
btn.style.whiteSpace = "nowrap";
|
||||
textField.style.whiteSpace = "nowrap";
|
||||
textView.style.whiteSpace = "nowrap";
|
||||
} else if (lbl.style.whiteSpace === "nowrap") {
|
||||
lbl.style.whiteSpace = "normal";
|
||||
btn.style.whiteSpace = "normal";
|
||||
textField.style.whiteSpace = "normal";
|
||||
textView.style.whiteSpace = "normal";
|
||||
}
|
||||
}
|
@ -1,9 +1,13 @@
|
||||
<Page >
|
||||
<ScrollView>
|
||||
<StackLayout width="50">
|
||||
<Button text="Change" tap="butonTap" />
|
||||
<Label id="Label1" text="Text Text" style.whiteSpace="normal" />
|
||||
<Button id="Change" text="Change" tap="butonTap" />
|
||||
<Label id="Label" text="label Label" style.whiteSpace="normal" />
|
||||
<Button id="Button" text="button Button" style.whiteSpace="normal" />
|
||||
<TextField id="TextField" text="textField textField" style.whiteSpace="normal" />
|
||||
<TextView id="TextView" text="textView textView" style.whiteSpace="normal" />
|
||||
|
||||
<!--
|
||||
<Label text="Label Normal" style="white-space:normal" />
|
||||
<Label text="Label Nowrap" style="white-space:nowrap" />
|
||||
|
||||
@ -15,6 +19,7 @@
|
||||
|
||||
<Button text="Button Normal" style="white-space:normal" />
|
||||
<Button text="Button Nowrap" style="white-space:nowrap" />
|
||||
-->
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
</Page>
|
@ -35,11 +35,6 @@ export function selectExample() {
|
||||
examples.set("basics", "bindings/basics");
|
||||
examples.set("xmlbasics", "bindings/xmlbasics");
|
||||
|
||||
examples.set("fontbtn", "font/button");
|
||||
examples.set("fontlbl", "font/label");
|
||||
examples.set("fontfield", "font/text-field");
|
||||
examples.set("fontview", "font/text-view");
|
||||
|
||||
examples.set("console", "pages/console");
|
||||
examples.set("gestures", "pages/gestures");
|
||||
examples.set("handlers", "pages/handlers");
|
||||
@ -52,10 +47,6 @@ examples.set("switch", "pages/switchandprogress"); // TODO: Update this test pag
|
||||
|
||||
examples.set("textfield", "text-field/text-field");
|
||||
|
||||
examples.set("decoration", "css/text-decoration");
|
||||
examples.set("whitespace", "css/white-space");
|
||||
examples.set("transform", "css/text-transform");
|
||||
|
||||
// ---
|
||||
|
||||
examples.set("actColor", "action-bar/color");
|
||||
@ -66,9 +57,18 @@ examples.set("actIcons", "action-bar/system-icons");
|
||||
examples.set("background", "css/background");
|
||||
examples.set("radius", "css/radius");
|
||||
examples.set("styles", "css/styles");
|
||||
examples.set("formatted", "css/decoration-transform-formattedtext");
|
||||
examples.set("decoration", "css/text-decoration");
|
||||
examples.set("transform", "css/text-transform");
|
||||
examples.set("whitespace", "css/white-space");
|
||||
|
||||
examples.set("dialogs", "dialogs/dialogs");
|
||||
|
||||
examples.set("fontbtn", "font/button");
|
||||
examples.set("fontlbl", "font/label");
|
||||
examples.set("fontfield", "font/text-field");
|
||||
examples.set("fontview", "font/text-view");
|
||||
|
||||
examples.set("htmlview", "html-view/html-view");
|
||||
|
||||
examples.set("absolute", "layouts/absolute");
|
||||
|
Reference in New Issue
Block a user