Skip to content

Commit 831552a

Browse files
committed
Merge branch 'master' of github.com:nativescript-community/ui-material-components
2 parents cfda47a + dc15bdf commit 831552a

File tree

23 files changed

+113
-17
lines changed

23 files changed

+113
-17
lines changed

demo-ng/App_Resources/iOS/Podfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
platform :ios, '10.0'

demo-ng/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"@nativescript-community/ui-material-slider": "file:../packages/slider",
2525
"@nativescript-community/ui-material-snackbar": "file:../packages/snackbar",
2626
"@nativescript-community/ui-material-textfield": "file:../packages/textfield",
27+
"@nativescript-community/ui-material-tabs": "file:../packages/tabs",
2728
"@nativescript/theme": "~3.0.0",
2829
"reflect-metadata": "~0.1.13",
2930
"rxjs": "~6.6.3",

demo-ng/src/app/examples/examples.module.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { SliderModule } from './slider/slider.module';
99
import { ProgressModule } from './progress/progress.module';
1010
import { ActivityIndicatorModule } from './activity-indicator/activity-indicator.module';
1111
import { BottomNavigationBarModule } from './bottom-navigation-bar/bottom-navigation-bar.module';
12+
import { TabsModule } from './tabs/tabs.module';
1213

1314
@NgModule({
1415
imports: [
@@ -21,7 +22,8 @@ import { BottomNavigationBarModule } from './bottom-navigation-bar/bottom-naviga
2122
SliderModule,
2223
ProgressModule,
2324
ActivityIndicatorModule,
24-
BottomNavigationBarModule
25+
BottomNavigationBarModule,
26+
TabsModule
2527
]
2628
})
2729
export class ExamplesModule {}

demo-ng/src/app/examples/examples.routing.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { SliderComponent } from './slider/slider.component';
1111
import { ProgressComponent } from './progress/progress.component';
1212
import { ActivityIndicatorComponent } from './activity-indicator/activity-indicator.component';
1313
import { BottomNavigationBarComponent } from './bottom-navigation-bar/bottom-navigation-bar.component';
14+
import { TabsComponent } from './tabs/tabs.component';
1415
// import { DialogComponent } from './dialog/dialog.component';
1516

1617
const routes: Routes = [
@@ -49,6 +50,10 @@ const routes: Routes = [
4950
{
5051
path: 'bottom-navigation-bar',
5152
component: BottomNavigationBarComponent
53+
},
54+
{
55+
path: 'tabs',
56+
component: TabsComponent
5257
}
5358
];
5459

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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 {}
Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
1-
<ActionBar
2-
title="Examples"
3-
class="action-bar"
4-
></ActionBar>
1+
<ActionBar title="Examples" class="action-bar"></ActionBar>
52

63
<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">
125
<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>
179
</ng-template>
1810
</ListView>
19-
</GridLayout>
11+
</GridLayout>

demo-ng/src/app/home/home.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ export class HomeComponent implements OnInit {
1717
'Ripple',
1818
'Text Field',
1919
'Slider',
20-
'Progress'
20+
'Progress',
21+
'Tabs'
2122
];
2223

2324
constructor(private router: RouterExtensions) {}

src/activityindicator/angular/tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,7 @@
1212
}
1313
},
1414
"include": ["./**/*.ts", "../../../references.d.ts", "../../references.d.ts"],
15+
"angularCompilerOptions": {
16+
"enableIvy": false
17+
}
1518
}

0 commit comments

Comments
 (0)