|
1 | | -import { rippleColorProperty, themer } from '@nativescript-community/ui-material-core'; |
| 1 | +import { themer } from '@nativescript-community/ui-material-core'; |
2 | 2 | import { Color, Device, Font, Frame, IOSHelper, ImageSource, Trace, Utils, View, ViewBase } from '@nativescript/core'; |
3 | 3 | import { TabsBase, swipeEnabledProperty } from './tabs-common'; |
4 | 4 |
|
@@ -492,6 +492,8 @@ export class Tabs extends TabsBase { |
492 | 492 |
|
493 | 493 | public _needsCacheUpdate = false; |
494 | 494 | public _animateNextChange = true; |
| 495 | + private _selectionIndicatorColor: Color; |
| 496 | + private _rippleColor: Color; |
495 | 497 |
|
496 | 498 | constructor() { |
497 | 499 | super(); |
@@ -1084,13 +1086,13 @@ export class Tabs extends TabsBase { |
1084 | 1086 | this._ios.tabBar.setImageTintColorForState(nativeColor, UIControlState.Selected); |
1085 | 1087 | } |
1086 | 1088 |
|
1087 | | - public getTabBarHighlightColor(): UIColor { |
1088 | | - return this._ios.tabBar.tintColor; |
| 1089 | + public getTabBarHighlightColor(): Color { |
| 1090 | + return this._selectionIndicatorColor; |
1089 | 1091 | } |
1090 | 1092 |
|
1091 | | - public setTabBarHighlightColor(value: UIColor | Color) { |
1092 | | - const nativeColor = value instanceof Color ? value.ios : value; |
1093 | | - this._ios.tabBar.tintColor = nativeColor; |
| 1093 | + public setTabBarHighlightColor(value: Color) { |
| 1094 | + this._selectionIndicatorColor = value; |
| 1095 | + this._ios.tabBar.selectionIndicatorStrokeColor = value.ios; |
1094 | 1096 | } |
1095 | 1097 |
|
1096 | 1098 | public getTabBarSelectedItemColor(): Color { |
@@ -1122,8 +1124,13 @@ export class Tabs extends TabsBase { |
1122 | 1124 | }); |
1123 | 1125 | } |
1124 | 1126 |
|
1125 | | - [rippleColorProperty.setNative](value: UIColor | Color) { |
1126 | | - this.setTabBarHighlightColor(value); |
| 1127 | + public setTabBarRippleColor(value: Color) { |
| 1128 | + this._rippleColor = value; |
| 1129 | + this._ios.tabBar.rippleColor = value.ios; |
| 1130 | + } |
| 1131 | + |
| 1132 | + public getTabBarRippleColor(): Color { |
| 1133 | + return this._rippleColor; |
1127 | 1134 | } |
1128 | 1135 |
|
1129 | 1136 | [selectedIndexProperty.setNative](value: number) { |
|
0 commit comments