File tree Expand file tree Collapse file tree 8 files changed +72
-16
lines changed Expand file tree Collapse file tree 8 files changed +72
-16
lines changed Original file line number Diff line number Diff line change 24
24
"@nativescript-community/ui-material-slider" : " file:../packages/slider" ,
25
25
"@nativescript-community/ui-material-snackbar" : " file:../packages/snackbar" ,
26
26
"@nativescript-community/ui-material-textfield" : " file:../packages/textfield" ,
27
+ "@nativescript-community/ui-material-tabs" : " file:../packages/tabs" ,
27
28
"@nativescript/theme" : " ~3.0.0" ,
28
29
"reflect-metadata" : " ~0.1.13" ,
29
30
"rxjs" : " ~6.6.3" ,
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import { SliderModule } from './slider/slider.module';
9
9
import { ProgressModule } from './progress/progress.module' ;
10
10
import { ActivityIndicatorModule } from './activity-indicator/activity-indicator.module' ;
11
11
import { BottomNavigationBarModule } from './bottom-navigation-bar/bottom-navigation-bar.module' ;
12
+ import { TabsModule } from './tabs/tabs.module' ;
12
13
13
14
@NgModule ( {
14
15
imports : [
@@ -21,7 +22,8 @@ import { BottomNavigationBarModule } from './bottom-navigation-bar/bottom-naviga
21
22
SliderModule ,
22
23
ProgressModule ,
23
24
ActivityIndicatorModule ,
24
- BottomNavigationBarModule
25
+ BottomNavigationBarModule ,
26
+ TabsModule
25
27
]
26
28
} )
27
29
export class ExamplesModule { }
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import { SliderComponent } from './slider/slider.component';
11
11
import { ProgressComponent } from './progress/progress.component' ;
12
12
import { ActivityIndicatorComponent } from './activity-indicator/activity-indicator.component' ;
13
13
import { BottomNavigationBarComponent } from './bottom-navigation-bar/bottom-navigation-bar.component' ;
14
+ import { TabsComponent } from './tabs/tabs.component' ;
14
15
// import { DialogComponent } from './dialog/dialog.component';
15
16
16
17
const routes : Routes = [
@@ -49,6 +50,10 @@ const routes: Routes = [
49
50
{
50
51
path : 'bottom-navigation-bar' ,
51
52
component : BottomNavigationBarComponent
53
+ } ,
54
+ {
55
+ path : 'tabs' ,
56
+ component : TabsComponent
52
57
}
53
58
] ;
54
59
Original file line number Diff line number Diff line change
1
+ < MDTabs selectedIndex ="1 ">
2
+ <!-- The bottom tab UI is created via TabStrip (the containier) and TabStripItem (for each tab)-->
3
+ < TabStrip >
4
+ < TabStripItem >
5
+ < Label text ="Home "> </ Label >
6
+ < Image src ="res://ic_home "> </ Image >
7
+ </ TabStripItem >
8
+ < TabStripItem >
9
+ < Label text ="Account "> </ Label >
10
+ < Image src ="res://ic_view_list "> </ Image >
11
+ </ TabStripItem >
12
+ < TabStripItem >
13
+ < Label text ="Search "> </ Label >
14
+ < Image src ="res://ic_menu "> </ Image >
15
+ </ TabStripItem >
16
+ </ TabStrip >
17
+
18
+ <!-- The number of TabContentItem components should corespond to the number of TabStripItem components -->
19
+ < TabContentItem >
20
+ < GridLayout >
21
+ < Label text ="Home Page " class ="h2 text-center "> </ Label >
22
+ </ GridLayout >
23
+ </ TabContentItem >
24
+ < TabContentItem >
25
+ < GridLayout >
26
+ < Label text ="Account Page " class ="h2 text-center "> </ Label >
27
+ </ GridLayout >
28
+ </ TabContentItem >
29
+ < TabContentItem >
30
+ < GridLayout >
31
+ < Label text ="Search Page " class ="h2 text-center "> </ Label >
32
+ </ GridLayout >
33
+ </ TabContentItem >
34
+ </ MDTabs >
Original file line number Diff line number Diff line change
1
+ import { Component , OnInit } from '@angular/core' ;
2
+
3
+ @Component ( {
4
+ selector : 'ns-buttons' ,
5
+ templateUrl : './tabs.component.html' ,
6
+ moduleId : module . id
7
+ } )
8
+ export class TabsComponent implements OnInit {
9
+ ngOnInit ( ) { }
10
+ }
Original file line number Diff line number Diff line change
1
+ import { NgModule , NO_ERRORS_SCHEMA } from '@angular/core' ;
2
+ import { NativeScriptCommonModule } from '@nativescript/angular' ;
3
+ import { NativeScriptMaterialTabsModule } from '@nativescript-community/ui-material-tabs/angular' ;
4
+ import { TabsComponent } from './tabs.component' ;
5
+
6
+ @NgModule ( {
7
+ declarations : [ TabsComponent ] ,
8
+ imports : [ NativeScriptCommonModule , NativeScriptMaterialTabsModule ] ,
9
+ schemas : [ NO_ERRORS_SCHEMA ]
10
+ } )
11
+ export class TabsModule { }
Original file line number Diff line number Diff line change 1
- < ActionBar
2
- title ="Examples "
3
- class ="action-bar "
4
- > </ ActionBar >
1
+ < ActionBar title ="Examples " class ="action-bar "> </ ActionBar >
5
2
6
3
< GridLayout class ="page ">
7
- < ListView
8
- [items] ="examples "
9
- (itemTap) ="goToExample($event) "
10
- class ="list-group "
11
- >
4
+ < ListView [items] ="examples " (itemTap) ="goToExample($event) " class ="list-group ">
12
5
< ng-template let-example ="item ">
13
- < Label
14
- [text] ="example "
15
- class ="list-group-item "
16
- > </ Label >
6
+ < StackLayout >
7
+ < Label [text] ="example " class ="list-group-item "> </ Label >
8
+ </ StackLayout >
17
9
</ ng-template >
18
10
</ ListView >
19
- </ GridLayout >
11
+ </ GridLayout >
Original file line number Diff line number Diff line change @@ -17,7 +17,8 @@ export class HomeComponent implements OnInit {
17
17
'Ripple' ,
18
18
'Text Field' ,
19
19
'Slider' ,
20
- 'Progress'
20
+ 'Progress' ,
21
+ 'Tabs'
21
22
] ;
22
23
23
24
constructor ( private router : RouterExtensions ) { }
You can’t perform that action at this time.
0 commit comments