| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,31 @@ | |||
| 1 | + .custom-tabstrip { | ||
| 2 | + height: 100; | ||
| 3 | + vertical-align: bottom; | ||
| 4 | + ios-overflow-safe-area-enabled: false; | ||
| 5 | + } | ||
| 6 | + | ||
| 7 | + .custom-tabstripitem { | ||
| 8 | + height: 80; | ||
| 9 | + width: 80; | ||
| 10 | + vertical-align: center; | ||
| 11 | + horizontal-align: center; | ||
| 12 | + clip-path: circle(100% at 50% 50%); | ||
| 13 | + } | ||
| 14 | + | ||
| 15 | + .custom-title { | ||
| 16 | + color: white; | ||
| 17 | + vertical-align: center; | ||
| 18 | + horizontal-align: center; | ||
| 19 | + } | ||
| 20 | + | ||
| 21 | + .skyblue { | ||
| 22 | + background-color: skyblue; | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | + .gold { | ||
| 26 | + background-color: gold; | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + .olive { | ||
| 30 | + background-color: olive; | ||
| 31 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,24 @@ | |||
| 1 | + import { EventData } from "tns-core-modules/data/observable"; | ||
| 2 | + import { Page } from "tns-core-modules/ui/page"; | ||
| 3 | + import { BottomNavigation } from "tns-core-modules/ui/bottom-navigation"; | ||
| 4 | + | ||
| 5 | + export function goToFirst(args: EventData) { | ||
| 6 | + const page = <Page>(<any>args.object).page; | ||
| 7 | + const bottomNav = <BottomNavigation>page.getViewById("bottomNav"); | ||
| 8 | + | ||
| 9 | + bottomNav.selectedIndex = 0; | ||
| 10 | + } | ||
| 11 | + | ||
| 12 | + export function goToSecond(args: EventData) { | ||
| 13 | + const page = <Page>(<any>args.object).page; | ||
| 14 | + const bottomNav = <BottomNavigation>page.getViewById("bottomNav"); | ||
| 15 | + | ||
| 16 | + bottomNav.selectedIndex = 1; | ||
| 17 | + } | ||
| 18 | + | ||
| 19 | + export function goToThird(args: EventData) { | ||
| 20 | + const page = <Page>(<any>args.object).page; | ||
| 21 | + const bottomNav = <BottomNavigation>page.getViewById("bottomNav"); | ||
| 22 | + | ||
| 23 | + bottomNav.selectedIndex = 2; | ||
| 24 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,41 @@ | |||
| 1 | + <Page> | ||
| 2 | + | ||
| 3 | + <ActionBar title="BottomNavigation Custom TabStrip" icon="" class="action-bar"> | ||
| 4 | + </ActionBar> | ||
| 5 | + | ||
| 6 | + <GridLayout> | ||
| 7 | + <GridLayout> | ||
| 8 | + <BottomNavigation id="bottomNav" automationText="tabNavigation" > | ||
| 9 | + <TabContentItem> | ||
| 10 | + <GridLayout backgroundColor="skyblue"> | ||
| 11 | + <Label text="First View"/> | ||
| 12 | + </GridLayout> | ||
| 13 | + </TabContentItem> | ||
| 14 | + <TabContentItem> | ||
| 15 | + <GridLayout backgroundColor="gold"> | ||
| 16 | + <Label text="Second View"/> | ||
| 17 | + </GridLayout> | ||
| 18 | + </TabContentItem> | ||
| 19 | + <TabContentItem> | ||
| 20 | + <GridLayout backgroundColor="olive"> | ||
| 21 | + <Label text="Third View"/> | ||
| 22 | + </GridLayout> | ||
| 23 | + </TabContentItem> | ||
| 24 | + </BottomNavigation> | ||
| 25 | + </GridLayout> | ||
| 26 | + | ||
| 27 | + <GridLayout columns="*, *, *" class="custom-tabstrip"> | ||
| 28 | + <GridLayout automationText="first-tab" col="0" class="custom-tabstripitem skyblue" tap="goToFirst"> | ||
| 29 | + <Label text="First" class="custom-title"></Label> | ||
| 30 | + </GridLayout> | ||
| 31 | + | ||
| 32 | + <GridLayout automationText="second-tab" col="1" class="custom-tabstripitem gold" tap="goToSecond"> | ||
| 33 | + <Label text="Second" class="custom-title"></Label> | ||
| 34 | + </GridLayout> | ||
| 35 | + | ||
| 36 | + <GridLayout automationText="third-tab" col="2" class="custom-tabstripitem olive" tap="goToThird"> | ||
| 37 | + <Label text="Third" class="custom-title"></Label> | ||
| 38 | + </GridLayout> | ||
| 39 | + </GridLayout> | ||
| 40 | + </GridLayout> | ||
| 41 | + </Page> | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,6 +23,7 @@ export function loadExamples() { | |||
| 23 | 23 | examples.set("font-icons", "bottom-navigation/font-icons-page"); | |
| 24 | 24 | examples.set("fancy-fonts", "bottom-navigation/fancy-fonts-page"); | |
| 25 | 25 | examples.set("css-text-transform", "bottom-navigation/bottom-navigation-css-page"); | |
| 26 | + examples.set("custom-tabstrip", "bottom-navigation/custom-tabstrip-page"); | ||
| 26 | 27 | ||
| 27 | 28 | return examples; | |
| 28 | 29 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,31 @@ | |||
| 1 | + .custom-tabstrip { | ||
| 2 | + height: 100; | ||
| 3 | + vertical-align: bottom; | ||
| 4 | + ios-overflow-safe-area-enabled: false; | ||
| 5 | + } | ||
| 6 | + | ||
| 7 | + .custom-tabstripitem { | ||
| 8 | + height: 80; | ||
| 9 | + width: 80; | ||
| 10 | + vertical-align: center; | ||
| 11 | + horizontal-align: center; | ||
| 12 | + clip-path: circle(100% at 50% 50%); | ||
| 13 | + } | ||
| 14 | + | ||
| 15 | + .custom-title { | ||
| 16 | + color: white; | ||
| 17 | + vertical-align: center; | ||
| 18 | + horizontal-align: center; | ||
| 19 | + } | ||
| 20 | + | ||
| 21 | + .skyblue { | ||
| 22 | + background-color: skyblue; | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | + .gold { | ||
| 26 | + background-color: gold; | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + .olive { | ||
| 30 | + background-color: olive; | ||
| 31 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,24 @@ | |||
| 1 | + import { EventData } from "tns-core-modules/data/observable"; | ||
| 2 | + import { Page } from "tns-core-modules/ui/page"; | ||
| 3 | + import { Tabs } from "tns-core-modules/ui/tabs"; | ||
| 4 | + | ||
| 5 | + export function goToFirst(args: EventData) { | ||
| 6 | + const page = <Page>(<any>args.object).page; | ||
| 7 | + const bottomNav = <Tabs>page.getViewById("tabsNav"); | ||
| 8 | + | ||
| 9 | + bottomNav.selectedIndex = 0; | ||
| 10 | + } | ||
| 11 | + | ||
| 12 | + export function goToSecond(args: EventData) { | ||
| 13 | + const page = <Page>(<any>args.object).page; | ||
| 14 | + const bottomNav = <Tabs>page.getViewById("tabsNav"); | ||
| 15 | + | ||
| 16 | + bottomNav.selectedIndex = 1; | ||
| 17 | + } | ||
| 18 | + | ||
| 19 | + export function goToThird(args: EventData) { | ||
| 20 | + const page = <Page>(<any>args.object).page; | ||
| 21 | + const bottomNav = <Tabs>page.getViewById("tabsNav"); | ||
| 22 | + | ||
| 23 | + bottomNav.selectedIndex = 2; | ||
| 24 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,41 @@ | |||
| 1 | + <Page> | ||
| 2 | + | ||
| 3 | + <ActionBar title="Tabs Custom TabStrip" icon="" class="action-bar"> | ||
| 4 | + </ActionBar> | ||
| 5 | + | ||
| 6 | + <GridLayout> | ||
| 7 | + <GridLayout> | ||
| 8 | + <Tabs id="tabsNav" automationText="tabNavigation" > | ||
| 9 | + <TabContentItem> | ||
| 10 | + <GridLayout backgroundColor="skyblue"> | ||
| 11 | + <Label text="First View"/> | ||
| 12 | + </GridLayout> | ||
| 13 | + </TabContentItem> | ||
| 14 | + <TabContentItem> | ||
| 15 | + <GridLayout backgroundColor="gold"> | ||
| 16 | + <Label text="Second View"/> | ||
| 17 | + </GridLayout> | ||
| 18 | + </TabContentItem> | ||
| 19 | + <TabContentItem> | ||
| 20 | + <GridLayout backgroundColor="olive"> | ||
| 21 | + <Label text="Third View"/> | ||
| 22 | + </GridLayout> | ||
| 23 | + </TabContentItem> | ||
| 24 | + </Tabs> | ||
| 25 | + </GridLayout> | ||
| 26 | + | ||
| 27 | + <GridLayout columns="*, *, *" class="custom-tabstrip"> | ||
| 28 | + <GridLayout automationText="first-tab" col="0" class="custom-tabstripitem skyblue" tap="goToFirst"> | ||
| 29 | + <Label text="First" class="custom-title"></Label> | ||
| 30 | + </GridLayout> | ||
| 31 | + | ||
| 32 | + <GridLayout automationText="second-tab" col="1" class="custom-tabstripitem gold" tap="goToSecond"> | ||
| 33 | + <Label text="Second" class="custom-title"></Label> | ||
| 34 | + </GridLayout> | ||
| 35 | + | ||
| 36 | + <GridLayout automationText="third-tab" col="2" class="custom-tabstripitem olive" tap="goToThird"> | ||
| 37 | + <Label text="Third" class="custom-title"></Label> | ||
| 38 | + </GridLayout> | ||
| 39 | + </GridLayout> | ||
| 40 | + </GridLayout> | ||
| 41 | + </Page> | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,6 +29,7 @@ export function loadExamples() { | |||
| 29 | 29 | examples.set("font-icons", "tabs/font-icons-page"); | |
| 30 | 30 | examples.set("nested-layout", "tabs/nested-layout-page"); | |
| 31 | 31 | examples.set("nested-bottom-navigation", "tabs/nested-bottom-navigation-page"); | |
| 32 | + examples.set("custom-tabstrip", "tabs/custom-tabstrip-page"); | ||
| 32 | 33 | ||
| 33 | 34 | return examples; | |
| 34 | 35 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,6 +40,7 @@ describe(`${suite}-${spec}-suite`, async function () { | |||
| 40 | 40 | ||
| 41 | 41 | it(`${spec}-background-color`, async function () { | |
| 42 | 42 | await bottomNavigationBasePage.navigateToSample("background-color"); | |
| 43 | + await bottomNavigationBasePage.refreshTabItems(); | ||
| 43 | 44 | await driver.imageHelper.compareScreen(); | |
| 44 | 45 | ||
| 45 | 46 | await bottomNavigationBasePage.tabOnItem(1); | |
@@ -55,6 +56,7 @@ describe(`${suite}-${spec}-suite`, async function () { | |||
| 55 | 56 | */ | |
| 56 | 57 | it(`${spec}-binding-add-items`, async function () { | |
| 57 | 58 | await bottomNavigationBasePage.navigateToSample("binding"); | |
| 59 | + await bottomNavigationBasePage.refreshTabItems(); | ||
| 58 | 60 | await driver.imageHelper.compareScreen(); | |
| 59 | 61 | ||
| 60 | 62 | const addTabBtn = await driver.waitForElement("add-tab"); | |
@@ -83,6 +85,7 @@ describe(`${suite}-${spec}-suite`, async function () { | |||
| 83 | 85 | */ | |
| 84 | 86 | it(`${spec}-binding-remove-items`, async function () { | |
| 85 | 87 | await bottomNavigationBasePage.navigateToSample("binding"); | |
| 88 | + await bottomNavigationBasePage.refreshTabItems(); | ||
| 86 | 89 | await driver.imageHelper.compareScreen(); | |
| 87 | 90 | ||
| 88 | 91 | const removeTabBtn = await driver.waitForElement("remove-last-tab"); | |
@@ -115,6 +118,7 @@ describe(`${suite}-${spec}-suite`, async function () { | |||
| 115 | 118 | ||
| 116 | 119 | it(`${spec}-bottom-navigation`, async function () { | |
| 117 | 120 | await bottomNavigationBasePage.navigateToSample("bottom-navigation"); | |
| 121 | + await bottomNavigationBasePage.refreshTabItems(); | ||
| 118 | 122 | await driver.imageHelper.compareScreen(); | |
| 119 | 123 | ||
| 120 | 124 | const goToSecondBtn = await driver.waitForElement("goToSecond"); | |
@@ -130,6 +134,7 @@ describe(`${suite}-${spec}-suite`, async function () { | |||
| 130 | 134 | ||
| 131 | 135 | it(`${spec}-color`, async function () { | |
| 132 | 136 | await bottomNavigationBasePage.navigateToSample("color"); | |
| 137 | + await bottomNavigationBasePage.refreshTabItems(); | ||
| 133 | 138 | await driver.imageHelper.compareScreen(); | |
| 134 | 139 | ||
| 135 | 140 | await bottomNavigationBasePage.tabOnItem(1); | |
@@ -141,6 +146,7 @@ describe(`${suite}-${spec}-suite`, async function () { | |||
| 141 | 146 | ||
| 142 | 147 | it(`${spec}-fancy-fonts-select-tabs`, async function () { | |
| 143 | 148 | await bottomNavigationBasePage.navigateToSample("fancy-fonts"); | |
| 149 | + await bottomNavigationBasePage.refreshTabItems(); | ||
| 144 | 150 | await driver.imageHelper.compareScreen(); | |
| 145 | 151 | ||
| 146 | 152 | for (let index = 1; index < 4; index++) { | |
@@ -154,6 +160,7 @@ describe(`${suite}-${spec}-suite`, async function () { | |||
| 154 | 160 | ||
| 155 | 161 | it(`${spec}-fancy-fonts-selected-index`, async function () { | |
| 156 | 162 | await bottomNavigationBasePage.navigateToSample("fancy-fonts"); | |
| 163 | + await bottomNavigationBasePage.refreshTabItems(); | ||
| 157 | 164 | ||
| 158 | 165 | let selectSecondTabFromCodeBehind = await driver.waitForElement("selectSecondTab"); | |
| 159 | 166 | logInfo(`Click on "select second tab button"`); | |
@@ -186,6 +193,7 @@ describe(`${suite}-${spec}-suite`, async function () { | |||
| 186 | 193 | ||
| 187 | 194 | it(`${spec}-fancy-fonts-change-orientation`, async function () { | |
| 188 | 195 | await bottomNavigationBasePage.navigateToSample("fancy-fonts"); | |
| 196 | + await bottomNavigationBasePage.refreshTabItems(); | ||
| 189 | 197 | await driver.setOrientation(DeviceOrientation.LANDSCAPE); | |
| 190 | 198 | await driver.imageHelper.compareScreen(); | |
| 191 | 199 | ||
@@ -212,6 +220,7 @@ describe(`${suite}-${spec}-suite`, async function () { | |||
| 212 | 220 | ||
| 213 | 221 | it(`${spec}-font-icons`, async function () { | |
| 214 | 222 | await bottomNavigationBasePage.navigateToSample("font-icons"); | |
| 223 | + await bottomNavigationBasePage.refreshTabItems(); | ||
| 215 | 224 | await driver.imageHelper.compareScreen(); | |
| 216 | 225 | ||
| 217 | 226 | await bottomNavigationBasePage.tabOnItem(1); | |
@@ -227,6 +236,7 @@ describe(`${suite}-${spec}-suite`, async function () { | |||
| 227 | 236 | ||
| 228 | 237 | it(`${spec}-icon-change`, async function () { | |
| 229 | 238 | await bottomNavigationBasePage.navigateToSample("icon-change"); | |
| 239 | + await bottomNavigationBasePage.refreshTabItems(); | ||
| 230 | 240 | await bottomNavigationBasePage.tabOnItem(1); | |
| 231 | 241 | await driver.imageHelper.compareScreen(); | |
| 232 | 242 | ||
@@ -240,13 +250,15 @@ describe(`${suite}-${spec}-suite`, async function () { | |||
| 240 | 250 | ||
| 241 | 251 | it(`${spec}-icon-title-placment`, async function () { | |
| 242 | 252 | await bottomNavigationBasePage.navigateToSample("icon-title-placement"); | |
| 253 | + await bottomNavigationBasePage.refreshTabItems(); | ||
| 243 | 254 | await driver.imageHelper.compareScreen(); | |
| 244 | 255 | assert.isTrue(driver.imageHelper.hasImageComparisonPassed()); | |
| 245 | 256 | await bottomNavigationBasePage.navigateBackToSuitMainPage(); | |
| 246 | 257 | }); | |
| 247 | 258 | ||
| 248 | 259 | it(`${spec}-5470-issue`, async function () { | |
| 249 | 260 | await bottomNavigationBasePage.navigateToSample("issue-5470"); | |
| 261 | + await bottomNavigationBasePage.refreshTabItems(); | ||
| 250 | 262 | await driver.imageHelper.compareScreen(); | |
| 251 | 263 | ||
| 252 | 264 | await bottomNavigationBasePage.tabOnItem(1); | |
@@ -258,6 +270,7 @@ describe(`${suite}-${spec}-suite`, async function () { | |||
| 258 | 270 | ||
| 259 | 271 | it(`${spec}-text-transform`, async function () { | |
| 260 | 272 | await bottomNavigationBasePage.navigateToSample("text-transform"); | |
| 273 | + await bottomNavigationBasePage.refreshTabItems(); | ||
| 261 | 274 | await driver.imageHelper.compareScreen(); | |
| 262 | 275 | ||
| 263 | 276 | await bottomNavigationBasePage.tabOnItem(1); | |
@@ -269,6 +282,7 @@ describe(`${suite}-${spec}-suite`, async function () { | |||
| 269 | 282 | ||
| 270 | 283 | it(`${spec}-fonts`, async function () { | |
| 271 | 284 | await bottomNavigationBasePage.navigateToSample("text-transform"); | |
| 285 | + await bottomNavigationBasePage.refreshTabItems(); | ||
| 272 | 286 | await driver.imageHelper.compareScreen(); | |
| 273 | 287 | ||
| 274 | 288 | await bottomNavigationBasePage.tabOnItem(1); | |
@@ -277,4 +291,16 @@ describe(`${suite}-${spec}-suite`, async function () { | |||
| 277 | 291 | assert.isTrue(driver.imageHelper.hasImageComparisonPassed()); | |
| 278 | 292 | await bottomNavigationBasePage.navigateBackToSuitMainPage(); | |
| 279 | 293 | }); | |
| 294 | + | ||
| 295 | + it(`${spec}-custom-tabstrip`, async function () { | ||
| 296 | + await bottomNavigationBasePage.navigateToSample("custom-tabstrip"); | ||
| 297 | + await driver.imageHelper.compareScreen(); | ||
| 298 | + | ||
| 299 | + const secondTab = await driver.waitForElement("second-tab"); | ||
| 300 | + await secondTab.tap(); | ||
| 301 | + await driver.imageHelper.compareScreen(); | ||
| 302 | + | ||
| 303 | + assert.isTrue(driver.imageHelper.hasImageComparisonPassed()); | ||
| 304 | + await bottomNavigationBasePage.navigateBackToSuitMainPage(); | ||
| 305 | + }); | ||
| 280 | 306 | }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,7 +21,6 @@ export abstract class TabNavigationBasePage extends PageObjectBaseModel { | |||
| 21 | 21 | ||
| 22 | 22 | async navigateToSample(sample: string) { | |
| 23 | 23 | await super.navigateToSample(sample); | |
| 24 | - await this.refreshTabItems(); | ||
| 25 | 24 | } | |
| 26 | 25 | ||
| 27 | 26 | async refreshTabItems() { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments