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 11@import '@nativescript/theme/css/core.css' ;
22@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 11< MDTabs selectedIndex ="1 ">
22 <!-- The bottom tab UI is created via MDTabStrip (the containier) and MDTabStripItem (for each tab)-->
3- < MDTabStrip >
3+ < MDTabStrip >
44 < MDTabStripItem >
55 < Label text ="Home "> </ Label >
66 < 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 {
3737
3838 return ref && ref . get ( ) ;
3939}
40+ interface PositionChanger {
41+ onSelectedPositionChange ( position : number , prevPosition : number ) ;
42+ }
4043
4144function initializeNativeClasses ( ) {
4245 if ( PagerAdapter ) {
@@ -282,7 +285,7 @@ function initializeNativeClasses() {
282285 }
283286
284287 @NativeClass
285- class TabsBarImplementation extends com . nativescript . material . core . TabsBar {
288+ class TabsBarImplementation extends com . nativescript . material . core . TabsBar implements PositionChanger {
286289 constructor ( context : android . content . Context , public owner : Tabs ) {
287290 super ( context ) ;
288291
@@ -477,6 +480,11 @@ export class Tabs extends TabsBase {
477480
478481 return nativeView ;
479482 }
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+ }
480488
481489 public initNativeView ( ) : void {
482490 super . initNativeView ( ) ;
You can’t perform that action at this time.
0 commit comments