-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added selectedItemColor and unSelectedItemColor to the TabStrip (#8431)
* chore: add guard for ios * feat(bottom-nav): adding new properties * feat(tabs): new property implementation * feat: new feature implementation in android Implemented selectedItemColor and unSelectedItemColor properties on TabStrip * chore: added some comments * chore: change method return type * fix: setting icon color * fix: rendering mode setting * chore: rename variable * chore: fixed a typo * chore: updated log in build gradle * fix: item color setting in android * fix: tab styling when no css aplied * chore: private methods renamed * tests: added selected-item test pages * chore: renamed test pages * chore: move css-tree package to the right place * tests: added new ui tests * fix: use renamed function * fix: set item color * tests: aded automationText attribute * tests: trying to fix the tests Co-authored-by: Dimitar Topuzov <dtopuzov@gmail.com>
- Loading branch information
Showing
22 changed files
with
670 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
import { EventData } from "tns-core-modules/data/observable"; | ||
import { TabView } from "tns-core-modules/ui/tab-view"; | ||
import { isIOS } from "tns-core-modules/platform"; | ||
|
||
export function onLoaded(args: EventData) { | ||
console.log("TEST", args.object); | ||
const tabView = <TabView>args.object; | ||
tabView.ios.tabBar.translucent = false; | ||
if (isIOS) { | ||
tabView.ios.tabBar.translucent = false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.font-awesome { | ||
font-family: "FontAwesome"; | ||
} | ||
|
||
.font-size { | ||
font-size: 36; | ||
} |
40 changes: 40 additions & 0 deletions
40
e2e/ui-tests-app/app/bottom-navigation/item-color-page.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<Page class="page"> | ||
|
||
<ActionBar title="BottomNavigation item-color" icon="" class="action-bar"> | ||
</ActionBar> | ||
|
||
<BottomNavigation automationText="tabNavigation"> | ||
<TabStrip selectedItemColor="red" unSelectedItemColor="green"> | ||
<TabStripItem> | ||
<Label text="First"/> | ||
<Image src="res://baseline_motorcycle_black_24"/> | ||
</TabStripItem> | ||
<TabStripItem> | ||
<Label text="Second"/> | ||
<Image src="res://up"/> | ||
</TabStripItem> | ||
<TabStripItem> | ||
<Label text="Third"/> | ||
<Image src="font://" class="font-awesome font-size" /> | ||
</TabStripItem> | ||
</TabStrip> | ||
|
||
<TabContentItem class="special"> | ||
<GridLayout> | ||
<Label text="First View" /> | ||
</GridLayout> | ||
</TabContentItem> | ||
|
||
<TabContentItem> | ||
<GridLayout> | ||
<Label text="Second View" /> | ||
</GridLayout> | ||
</TabContentItem> | ||
|
||
<TabContentItem> | ||
<GridLayout> | ||
<Label text="Third View" /> | ||
</GridLayout> | ||
</TabContentItem> | ||
</BottomNavigation> | ||
</Page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.font-awesome { | ||
font-family: "FontAwesome"; | ||
} | ||
|
||
.font-size { | ||
font-size: 36; | ||
} | ||
|
||
|
||
/* TabStrip { | ||
color: mediumvioletred; | ||
} | ||
TabStripItem { | ||
color: skyblue; | ||
} | ||
TabStripItem:active { | ||
color: darkblue; | ||
} */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<Page class="page"> | ||
|
||
<ActionBar title="Tabs item-color" icon="" class="action-bar"> | ||
</ActionBar> | ||
|
||
<Tabs automationText="tabNavigation"> | ||
<TabStrip selectedItemColor="red" unSelectedItemColor="green"> | ||
<TabStripItem> | ||
<Label text="First"/> | ||
<Image src="res://baseline_motorcycle_black_24"/> | ||
</TabStripItem> | ||
<TabStripItem> | ||
<Label text="Second"/> | ||
<Image src="res://up"/> | ||
</TabStripItem> | ||
<TabStripItem> | ||
<Label text="Third"/> | ||
<Image src="font://" class="font-awesome font-size" /> | ||
</TabStripItem> | ||
</TabStrip> | ||
|
||
<TabContentItem class="special"> | ||
<GridLayout> | ||
<Label text="First View" /> | ||
</GridLayout> | ||
</TabContentItem> | ||
|
||
<TabContentItem> | ||
<GridLayout> | ||
<Label text="Second View" /> | ||
</GridLayout> | ||
</TabContentItem> | ||
|
||
<TabContentItem> | ||
<GridLayout> | ||
<Label text="Third View" /> | ||
</GridLayout> | ||
</TabContentItem> | ||
</Tabs> | ||
</Page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,61 @@ | ||
{ | ||
"name": "@nativescript/core", | ||
"main": "index", | ||
"types": "index.d.ts", | ||
"description": "Telerik NativeScript Core Modules", | ||
"version": "6.5.0", | ||
"homepage": "https://www.nativescript.org", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/NativeScript/NativeScript" | ||
}, | ||
"files": [ | ||
"**/*.d.ts", | ||
"**/*.js", | ||
"**/platforms/ios/**", | ||
"**/platforms/android/**", | ||
"**/package.json", | ||
"!org.nativescript.widgets.d.ts" | ||
], | ||
"license": "Apache-2.0", | ||
"dependencies": { | ||
"nativescript-hook": "0.2.5", | ||
"reduce-css-calc": "^2.1.6", | ||
"css-tree": "^1.0.0-alpha.37", | ||
"semver": "6.3.0", | ||
"tns-core-modules-widgets": "next", | ||
"tslib": "1.10.0" | ||
}, | ||
"devDependencies": { | ||
"@types/chai": "~4.2.5", | ||
"@types/node": "~10.12.18", | ||
"tns-platform-declarations": "next" | ||
}, | ||
"scripts": { | ||
"version": "conventional-changelog -p angular -i ../CHANGELOG.md -s && git add ../CHANGELOG.md", | ||
"postinstall": "node cli-hooks/postinstall.js", | ||
"preuninstall": "node cli-hooks/preuninstall.js" | ||
}, | ||
"nativescript": { | ||
"platforms": { | ||
"ios": "6.0.0", | ||
"android": "6.0.0" | ||
"name": "@nativescript/core", | ||
"main": "index", | ||
"types": "index.d.ts", | ||
"description": "Telerik NativeScript Core Modules", | ||
"version": "6.5.0", | ||
"homepage": "https://www.nativescript.org", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/NativeScript/NativeScript" | ||
}, | ||
"hooks": [ | ||
{ | ||
"name": "nativescript-core", | ||
"type": "before-checkForChanges", | ||
"script": "cli-hooks/before-checkForChanges.js", | ||
"inject": true | ||
} | ||
] | ||
}, | ||
"snapshot": { | ||
"android": { | ||
"tns-java-classes": { | ||
"modules": [ | ||
"ui/frame/activity", | ||
"ui/frame/fragment" | ||
] | ||
} | ||
"files": [ | ||
"**/*.d.ts", | ||
"**/*.js", | ||
"**/platforms/ios/**", | ||
"**/platforms/android/**", | ||
"**/package.json", | ||
"!org.nativescript.widgets.d.ts" | ||
], | ||
"license": "Apache-2.0", | ||
"dependencies": { | ||
"css-tree": "^1.0.0-alpha.37", | ||
"nativescript-hook": "0.2.5", | ||
"reduce-css-calc": "^2.1.6", | ||
"semver": "6.3.0", | ||
"tns-core-modules-widgets": "next", | ||
"tslib": "1.10.0" | ||
}, | ||
"devDependencies": { | ||
"@types/chai": "~4.2.5", | ||
"@types/node": "~10.12.18", | ||
"tns-platform-declarations": "next" | ||
}, | ||
"scripts": { | ||
"version": "conventional-changelog -p angular -i ../CHANGELOG.md -s && git add ../CHANGELOG.md", | ||
"postinstall": "node cli-hooks/postinstall.js", | ||
"preuninstall": "node cli-hooks/preuninstall.js" | ||
}, | ||
"nativescript": { | ||
"platforms": { | ||
"ios": "6.0.0", | ||
"android": "6.0.0" | ||
}, | ||
"hooks": [{ | ||
"name": "nativescript-core", | ||
"type": "before-checkForChanges", | ||
"script": "cli-hooks/before-checkForChanges.js", | ||
"inject": true | ||
}] | ||
}, | ||
"snapshot": { | ||
"android": { | ||
"tns-java-classes": { | ||
"modules": [ | ||
"ui/frame/activity", | ||
"ui/frame/fragment" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.