| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -34,6 +34,11 @@ export function onToggle(args: EventData) { | |||
| 34 | 34 | target.backgroundImage = target.backgroundImage ? undefined : `~/ui-tests-app/resources/images/test2.png`; | |
| 35 | 35 | debugConsole.text += `> background-image: ${target.backgroundImage}\n`; | |
| 36 | 36 | } | |
| 37 | + else if (button.text === "BGGradient") { | ||
| 38 | + const gradient = "linear-gradient(to right, purple, red)"; | ||
| 39 | + target.backgroundImage = typeof target.backgroundImage === "object" ? undefined : gradient; | ||
| 40 | + debugConsole.text += `> background-image: ${gradient} \n`; | ||
| 41 | + } | ||
| 37 | 42 | ||
| 38 | 43 | scrollView.scrollToVerticalOffset(scrollView.scrollableHeight, true); | |
| 39 | 44 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,6 +17,7 @@ | |||
| 17 | 17 | <StackLayout id="target" row="1" col="1"> | |
| 18 | 18 | <Button text="BGColor" tap="onToggle"/> | |
| 19 | 19 | <Button text="BGImage" tap="onToggle"/> | |
| 20 | + <Button text="BGGradient" tap="onToggle"/> | ||
| 20 | 21 | </StackLayout> | |
| 21 | 22 | <StackLayout id="right" class="button-container" row="1" col="2"> | |
| 22 | 23 | <Button text="Color" id="borderRightColor" tap="onToggle"/> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,41 @@ | |||
| 1 | + import * as pages from "tns-core-modules/ui/page"; | ||
| 2 | + import { EventData } from "tns-core-modules/data/observable"; | ||
| 3 | + import * as button from "tns-core-modules/ui/button"; | ||
| 4 | + | ||
| 5 | + import { GridLayout } from "tns-core-modules/ui/layouts/grid-layout"; | ||
| 6 | + | ||
| 7 | + let testIndex = 0; | ||
| 8 | + const tests = [ | ||
| 9 | + { name: "black-blue only", backgroundImage: "linear-gradient(to bottom, black, blue)"}, | ||
| 10 | + { name: "to bottom green-blue", backgroundImage: "linear-gradient(to bottom, green, blue)"}, | ||
| 11 | + { name: "to left yellow-blue", backgroundImage: "linear-gradient(to left, yellow, green)"}, | ||
| 12 | + { name: "to right yellow-blue", backgroundImage: "linear-gradient(to right, yellow, green)"}, | ||
| 13 | + { name: "-45deg green-blue", backgroundImage: "linear-gradient(-45deg, green, blue)"}, | ||
| 14 | + { name: "45deg green-blue", backgroundImage: "linear-gradient(45deg, green, blue)"}, | ||
| 15 | + | ||
| 16 | + { name: "black-blue-pink only", backgroundImage: "linear-gradient(to bottom, black, blue, pink)"}, | ||
| 17 | + { name: "to bottom green-blue-pink", backgroundImage: "linear-gradient(to bottom, green, blue, pink)"}, | ||
| 18 | + { name: "to left yellow-blue-pink", backgroundImage: "linear-gradient(to left, yellow, green, pink)"}, | ||
| 19 | + { name: "to right yellow-blue-pink", backgroundImage: "linear-gradient(to right, yellow, green, pink)"}, | ||
| 20 | + { name: "-45deg green-blue-pink", backgroundImage: "linear-gradient(-45deg, green, blue, pink)"}, | ||
| 21 | + { name: "45deg green-blue-pink", backgroundImage: "linear-gradient(45deg, green, blue, pink)"}, | ||
| 22 | + ] | ||
| 23 | + | ||
| 24 | + export function onLoaded(args) { | ||
| 25 | + applyNextStyle(args); | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + export function onButtonTap(args) { | ||
| 29 | + applyNextStyle(args); | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + function applyNextStyle(args) { | ||
| 33 | + let page = <pages.Page>args.object.page; | ||
| 34 | + let btn = <button.Button>args.object; | ||
| 35 | + let gridElement = <GridLayout>page.getViewById("Container"); | ||
| 36 | + | ||
| 37 | + btn.text = tests[testIndex].name; | ||
| 38 | + gridElement.backgroundImage = tests[testIndex].backgroundImage; | ||
| 39 | + | ||
| 40 | + testIndex = testIndex < tests.length - 1 ? ++testIndex : 0; | ||
| 41 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,7 @@ | |||
| 1 | + <Page xmlns="http://schemas.nativescript.org/tns.xsd" loaded="onLoaded"> | ||
| 2 | + <GridLayout rows="*, 7*"> | ||
| 3 | + <Button row="0" text="a1" tap="onButtonTap"/> | ||
| 4 | + | ||
| 5 | + <GridLayout id="Container" fontSize="12" borderColor="black" margin="5" borderWidth="1" row="1"/> | ||
| 6 | + </GridLayout> | ||
| 7 | + </Page> | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,7 +9,9 @@ const tests = [ | |||
| 9 | 9 | { name: "black hex color only", background: "#000000" }, | |
| 10 | 10 | { name: "yellow hex color only", background: "#ffff00" }, | |
| 11 | 11 | { name: "blue color only", background: "blue" }, | |
| 12 | + | ||
| 12 | 13 | { name: "repeat image only", background: "url(\"~/ui-tests-app/resources/images/icon.png\")" }, | |
| 14 | + { name: "linear gradient red-blue only", background: "linear-gradient(to bottom, red, blue)"}, | ||
| 13 | 15 | ||
| 14 | 16 | { name: "[straight] image only, no-repeat ", background: "url(\"~/ui-tests-app/resources/images/icon.png\") no-repeat" }, | |
| 15 | 17 | { name: "[straight] green color, image, no-repeat", background: "green url(\"~/ui-tests-app/resources/images/icon.png\") no-repeat" }, | |
@@ -18,7 +20,7 @@ const tests = [ | |||
| 18 | 20 | { name: "[straight] orange hex color, image, no-repeat, position percents", background: "#F9791F url(\"~/ui-tests-app/resources/images/icon.png\") no-repeat 100% 100%" }, | |
| 19 | 21 | { name: "[straight] green color, image, repeat-x, position percents", background: "green url(\"~/ui-tests-app/resources/images/icon.png\") repeat-x 100% 100%" }, | |
| 20 | 22 | { name: "[straight] blue color, image, repeat-x, position", background: "blue url(\"~/ui-tests-app/resources/images/icon.png\") repeat-x 150 150" }, | |
| 21 | - | ||
| 23 | + | ||
| 22 | 24 | { name: "[shuffle] no-repeat, image only", background: "no-repeat url(\"~/ui-tests-app/resources/images/icon.png\")" }, | |
| 23 | 25 | { name: "[shuffle] no-repeat, green color, image, ", background: "no-repeat green url(\"~/ui-tests-app/resources/images/icon.png\")" }, | |
| 24 | 26 | { name: "[shuffle] yellow hex color, position pixels, image, no-repeat", background: "#ffff00 200px 200px url(\"~/ui-tests-app/resources/images/icon.png\") no-repeat" }, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,77 @@ | |||
| 1 | + StackLayout { | ||
| 2 | + width: 80; | ||
| 3 | + height: 80; | ||
| 4 | + background: linear-gradient(to top, green, blue); | ||
| 5 | + } | ||
| 6 | + | ||
| 7 | + #s0 { | ||
| 8 | + border-width: 5; | ||
| 9 | + } | ||
| 10 | + | ||
| 11 | + #s1 { | ||
| 12 | + border-width: 5; border-color: red; | ||
| 13 | + } | ||
| 14 | + | ||
| 15 | + #s2 { | ||
| 16 | + border-width: 5; border-color: red red red green; | ||
| 17 | + } | ||
| 18 | + | ||
| 19 | + #s3 { | ||
| 20 | + border-width: 5; border-color: red; border-radius: 5; | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + #s4 { | ||
| 24 | + border-width: 5; border-color: red; border-radius: 50; | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + #s5 { | ||
| 28 | + border-width: 5 10 15 20; border-color: red; | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + #s6 { | ||
| 32 | + border-width: 5; border-color: red green blue yellow; | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + #s7 { | ||
| 36 | + border-width: 5 10 15 20; border-color: red green blue yellow; | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + #s8 { | ||
| 40 | + border-width: 5 10; border-color: red green; | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + #s9 { | ||
| 44 | + border-width: 15 10 5; border-color: red green blue; | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + #s10 { | ||
| 48 | + border-width: 5 0; border-color: black; | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + #s11 { | ||
| 52 | + background-color: magenta; | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + #s12 { | ||
| 56 | + border-width: 5 10 15 20; border-color: red green blue yellow; border-radius: 5 10 15 20; | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + #s13 { | ||
| 60 | + border-width: 5 10 15 20; border-color: red green blue yellow; border-radius: 5; | ||
| 61 | + } | ||
| 62 | + | ||
| 63 | + #s14 { | ||
| 64 | + border-width: 5 10 15 20; border-color: red green blue yellow; background-color: magenta; | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + #s15 { | ||
| 68 | + border-width: 5 10 15 20; border-color: red green blue yellow; background-image: url('~/ui-tests-app/resources/images/test2.png'); | ||
| 69 | + } | ||
| 70 | + | ||
| 71 | + #s16 { | ||
| 72 | + border-width: 5; border-color: red; padding: 5; | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + #s17 { | ||
| 76 | + border-width: 5 6 7 8; border-color: red green blue yellow; padding: 5 6 7 8; | ||
| 77 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,22 @@ | |||
| 1 | + <Page> | ||
| 2 | + <GridLayout rows="*,*,*,*,*,*" columns="*,*,*"> | ||
| 3 | + <StackLayout id="s0" row="0" col="0"/> | ||
| 4 | + <StackLayout id="s1" row="0" col="1"/> | ||
| 5 | + <StackLayout id="s2" row="0" col="2"/> | ||
| 6 | + <StackLayout id="s3" row="1" col="0"/> | ||
| 7 | + <StackLayout id="s4" row="1" col="1"/> | ||
| 8 | + <StackLayout id="s5" row="1" col="2"/> | ||
| 9 | + <StackLayout id="s6" row="2" col="0"/> | ||
| 10 | + <StackLayout id="s7" row="2" col="1"/> | ||
| 11 | + <StackLayout id="s8" row="2" col="2"/> | ||
| 12 | + <StackLayout id="s9" row="3" col="0"/> | ||
| 13 | + <StackLayout id="s10" row="3" col="1"/> | ||
| 14 | + <StackLayout id="s11" row="3" col="2"/> | ||
| 15 | + <StackLayout id="s12" row="4" col="0"/> | ||
| 16 | + <StackLayout id="s13" row="4" col="1"/> | ||
| 17 | + <StackLayout id="s14" row="4" col="2"/> | ||
| 18 | + <StackLayout id="s15" row="5" col="0"/> | ||
| 19 | + <StackLayout id="s16" row="5" col="1"/> | ||
| 20 | + <StackLayout id="s17" row="5" col="2"/> | ||
| 21 | + </GridLayout> | ||
| 22 | + </Page> | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,6 +30,7 @@ export function loadExamples() { | |||
| 30 | 30 | examples.set("label-border", "css/label-border"); | |
| 31 | 31 | examples.set("text-view-border", "css/text-view-border"); | |
| 32 | 32 | examples.set("image-border", "css/image-border"); | |
| 33 | + examples.set("gradient-border", "css/gradient-border"); | ||
| 33 | 34 | examples.set("layouts-border-overlap", "css/layouts-border-overlap"); | |
| 34 | 35 | examples.set("measure-tests", "css/measure-tests"); | |
| 35 | 36 | examples.set("all-uniform-border", "css/all-uniform-border"); | |
@@ -41,5 +42,6 @@ export function loadExamples() { | |||
| 41 | 42 | examples.set("non-uniform-radius", "css/non-uniform-radius"); | |
| 42 | 43 | examples.set("missing-background-image", "css/missing-background-image"); | |
| 43 | 44 | examples.set("background-shorthand", "css/background-shorthand"); | |
| 45 | + examples.set("background-image-linear-gradient", "css/background-image-linear-gradient"); | ||
| 44 | 46 | return examples; | |
| 45 | 47 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,5 +23,6 @@ export function loadExamples() { | |||
| 23 | 23 | examples.set("text-transform", "tab-view/text-transform"); | |
| 24 | 24 | examples.set("tab-view-bottom-position", "tab-view/tab-view-bottom-position"); | |
| 25 | 25 | examples.set("issue-5470", "tab-view/issue-5470"); | |
| 26 | + examples.set("tab-view-tab-text-font-size", "tab-view/tab-view-tab-text-font-size"); | ||
| 26 | 27 | return examples; | |
| 27 | 28 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,20 @@ | |||
| 1 | + <Page> | ||
| 2 | + <TabView tabTextFontSize="8"> | ||
| 3 | + <TabView.items> | ||
| 4 | + <TabViewItem title="First"> | ||
| 5 | + <TabViewItem.view> | ||
| 6 | + <GridLayout> | ||
| 7 | + <Label text="First View" verticalAlignment="center" horizontalAlignment="center"/> | ||
| 8 | + </GridLayout> | ||
| 9 | + </TabViewItem.view> | ||
| 10 | + </TabViewItem> | ||
| 11 | + <TabViewItem title="Second"> | ||
| 12 | + <TabViewItem.view> | ||
| 13 | + <GridLayout> | ||
| 14 | + <Label text="Second View" verticalAlignment="center" horizontalAlignment="center"/> | ||
| 15 | + </GridLayout> | ||
| 16 | + </TabViewItem.view> | ||
| 17 | + </TabViewItem> | ||
| 18 | + </TabView.items> | ||
| 19 | + </TabView> | ||
| 20 | + </Page> | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments