diff --git a/CHANGELOG.md b/CHANGELOG.md index c4f31053e..e46b3c5d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## [6.5.1](https://github.com/NativeScript/NativeScript/compare/6.5.0...6.5.1) (2020-03-30) + + +### Bug Fixes + +* **tabs:** dynamic styling colors fixed ([#8460](https://github.com/NativeScript/NativeScript/issues/8460)) ([0a7bee6](https://github.com/NativeScript/NativeScript/commit/0a7bee6)) + + + # [6.5.0](https://github.com/NativeScript/NativeScript/compare/6.4.2...6.5.0) (2020-03-18) diff --git a/api-reports/NativeScript.api.md b/api-reports/NativeScript.api.md index 1732b30d2..31e464aac 100644 --- a/api-reports/NativeScript.api.md +++ b/api-reports/NativeScript.api.md @@ -2262,6 +2262,8 @@ export class TabNavigationBase extends View { setTabBarIconColor(tabStripItem: TabStripItem, value: any): void + setTabBarIconSource(tabStripItem: TabStripItem, value: any): void + setTabBarItemBackgroundColor(tabStripItem: TabStripItem, value: any): void setTabBarItemColor(tabStripItem: TabStripItem, value: any): void diff --git a/e2e/ui-tests-app/app/bottom-navigation/dynamic-color-change-page.css b/e2e/ui-tests-app/app/bottom-navigation/dynamic-color-change-page.css new file mode 100644 index 000000000..7b8624417 --- /dev/null +++ b/e2e/ui-tests-app/app/bottom-navigation/dynamic-color-change-page.css @@ -0,0 +1,28 @@ +.font-awesome { + font-family: "FontAwesome"; +} + +.font-size { + font-size: 36; +} + +TabStripItem:active { + background-color: magenta; +} + +.tabsClass0 { +} + +.tabsClass1 { + background-color: #79d2a6; + highlight-color: green; + selected-item-color: yellow; + un-selected-item-color: blue; +} + +.tabsClass2 { + background-color: orangered; + highlight-color: lightgreen; + selected-item-color: whitesmoke; + un-selected-item-color: pink; +} \ No newline at end of file diff --git a/e2e/ui-tests-app/app/bottom-navigation/dynamic-color-change-page.ts b/e2e/ui-tests-app/app/bottom-navigation/dynamic-color-change-page.ts new file mode 100644 index 000000000..30fa51567 --- /dev/null +++ b/e2e/ui-tests-app/app/bottom-navigation/dynamic-color-change-page.ts @@ -0,0 +1,39 @@ +import { View } from "tns-core-modules/ui/core/view"; +import { Page } from "tns-core-modules/ui/page"; +import { BottomNavigation } from "tns-core-modules/ui/bottom-navigation"; + +export function onButtonTap(args) { + const page = (args.object).page; + const bottomNavigation = (page.getViewById("bottomNavigation")); + + switch (bottomNavigation.tabStrip.className) { + case "tabsClass0": + bottomNavigation.tabStrip.className = "tabsClass1"; + break; + case "tabsClass1": + bottomNavigation.tabStrip.className = "tabsClass2"; + break; + case "tabsClass2": + bottomNavigation.tabStrip.className = "tabsClass0"; + break; + } +} + +export function onChangeIconSourceTap(args) { + const page = (args.object).page; + const bottomNavigation = (page.getViewById("bottomNavigation")); + + const tabStripItem0 = bottomNavigation.tabStrip.items[0]; + const tabStripItem1 = bottomNavigation.tabStrip.items[1]; + const tabStripItem2 = bottomNavigation.tabStrip.items[2]; + + const iconSource0 = tabStripItem0.iconSource; + + tabStripItem0.iconSource = tabStripItem1.iconSource; + + tabStripItem1.iconClass = "font-awesome font-size"; + tabStripItem1.iconSource = tabStripItem2.iconSource; + + tabStripItem2.iconClass = "font-awesome font-size"; + tabStripItem2.iconSource = iconSource0; +} \ No newline at end of file diff --git a/e2e/ui-tests-app/app/bottom-navigation/dynamic-color-change-page.xml b/e2e/ui-tests-app/app/bottom-navigation/dynamic-color-change-page.xml new file mode 100644 index 000000000..989fab9ed --- /dev/null +++ b/e2e/ui-tests-app/app/bottom-navigation/dynamic-color-change-page.xml @@ -0,0 +1,44 @@ + + + +