File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 1
1
@import '@nativescript/theme/css/core.css' ;
2
2
@import '@nativescript/theme/css/default.css' ;
3
+
4
+ MDTabStrip {
5
+ selected-item-color : # FFFFFF ;
6
+ un-selected-item-color : # 404040 ;
7
+ highlight-color : # 4CFFFF ;
8
+ }
Original file line number Diff line number Diff line change 1
1
< MDTabs selectedIndex ="1 ">
2
2
<!-- The bottom tab UI is created via MDTabStrip (the containier) and MDTabStripItem (for each tab)-->
3
- < MDTabStrip >
3
+ < MDTabStrip >
4
4
< MDTabStripItem >
5
5
< Label text ="Home "> </ Label >
6
6
< Image src ="res://ic_home "> </ Image >
Original file line number Diff line number Diff line change @@ -37,6 +37,9 @@ function getTabById(id: number): Tabs {
37
37
38
38
return ref && ref . get ( ) ;
39
39
}
40
+ interface PositionChanger {
41
+ onSelectedPositionChange ( position : number , prevPosition : number ) ;
42
+ }
40
43
41
44
function initializeNativeClasses ( ) {
42
45
if ( PagerAdapter ) {
@@ -282,7 +285,7 @@ function initializeNativeClasses() {
282
285
}
283
286
284
287
@NativeClass
285
- class TabsBarImplementation extends com . nativescript . material . core . TabsBar {
288
+ class TabsBarImplementation extends com . nativescript . material . core . TabsBar implements PositionChanger {
286
289
constructor ( context : android . content . Context , public owner : Tabs ) {
287
290
super ( context ) ;
288
291
@@ -477,6 +480,11 @@ export class Tabs extends TabsBase {
477
480
478
481
return nativeView ;
479
482
}
483
+ onSelectedIndexChanged ( oldIndex : number , newIndex :number ) {
484
+ const tabBarImplementation = ( this . _tabsBar as unknown ) as PositionChanger ;
485
+ tabBarImplementation . onSelectedPositionChange ( oldIndex , newIndex ) ;
486
+ super . onSelectedIndexChanged ( oldIndex , newIndex ) ;
487
+ }
480
488
481
489
public initNativeView ( ) : void {
482
490
super . initNativeView ( ) ;
You can’t perform that action at this time.
0 commit comments