Skip to content

Commit 041efb9

Browse files
author
Vladimir Enchev
committed
Merge pull request NativeScript#148 from NativeScript/tab-entry-rename
TabEntry renamed to TabViewItem
2 parents 2bdf213 + bd9b813 commit 041efb9

File tree

10 files changed

+71
-71
lines changed

10 files changed

+71
-71
lines changed

apps/cuteness.io/main-page.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Page xmlns="http://www.nativescript.org/tns.xsd" loaded="pageLoaded">
22
<TabView>
33
<TabView.items>
4-
<TabEntry title="List">
5-
<TabEntry.view>
4+
<TabViewItem title="List">
5+
<TabViewItem.view>
66
<ListView items="{{ redditItems }}" isScrolling="{{ isScrolling }}" itemTap="listViewItemTap" loadMoreItems="listViewLoadMoreItems">
77
<ListView.itemTemplate>
88
<!-- Binding in template property of an component will use the bindingContext provided by the component. -->
@@ -15,16 +15,16 @@
1515
<!-- End of tempplate. -->
1616
</ListView.itemTemplate>
1717
</ListView>
18-
</TabEntry.view>
19-
</TabEntry>
20-
<TabEntry title="About">
21-
<TabEntry.view>
18+
</TabViewItem.view>
19+
</TabViewItem>
20+
<TabViewItem title="About">
21+
<TabViewItem.view>
2222
<StackLayout>
2323
<Image margin="10" url="~/app/res/telerik-logo.png" />
2424
<Label margin="10" textWrap="true" text="{{ aboutText }}" />
2525
</StackLayout>
26-
</TabEntry.view>
27-
</TabEntry>
26+
</TabViewItem.view>
27+
</TabViewItem>
2828
</TabView.items>
2929
</TabView>
3030
</Page>

apps/gallery-app/content/tab-view.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
<Page>
33
<TabView>
44
<TabView.items>
5-
<TabEntry title="First">
6-
<TabEntry.view>
5+
<TabViewItem title="First">
6+
<TabViewItem.view>
77
<GridLayout>
88
<Label text="First Tab" verticalAlignment="center" horizontalAlignment="center"/>
99
</GridLayout>
10-
</TabEntry.view>
11-
</TabEntry>
12-
<TabEntry title="Second">
13-
<TabEntry.view>
10+
</TabViewItem.view>
11+
</TabViewItem>
12+
<TabViewItem title="Second">
13+
<TabViewItem.view>
1414
<GridLayout>
1515
<Label text="Second Tab" verticalAlignment="center" horizontalAlignment="center"/>
1616
</GridLayout>
17-
</TabEntry.view>
18-
</TabEntry>
17+
</TabViewItem.view>
18+
</TabViewItem>
1919
</TabView.items>
2020
</TabView>
2121
</Page>
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
<Page xmlns="http://www.nativescript.org/tns.xsd" loaded="pageLoaded">
22
<TabView>
33
<TabView.items>
4-
<TabEntry title="First">
5-
<TabEntry.view>
4+
<TabViewItem title="First">
5+
<TabViewItem.view>
66
<StackLayout cssClass="tab-content">
77
<Label text="First View" cssClass="title"/>
88
<Label text="This is the content of the first tab." textWrap="true"/>
99
</StackLayout>
10-
</TabEntry.view>
11-
</TabEntry>
12-
<TabEntry title="Second">
13-
<TabEntry.view>
10+
</TabViewItem.view>
11+
</TabViewItem>
12+
<TabViewItem title="Second">
13+
<TabViewItem.view>
1414
<StackLayout cssClass="tab-content">
1515
<Label text="Second View" cssClass="title"/>
1616
<Label text="This is the content of the second tab." textWrap="true"/>
1717
</StackLayout>
18-
</TabEntry.view>
19-
</TabEntry>
18+
</TabViewItem.view>
19+
</TabViewItem>
2020
</TabView.items>
2121
</TabView>
2222
</Page>

apps/tests/ui/tab-view/tab-view-tests.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ import buttonModule = require("ui/button");
1717
// <Page>
1818
// <TabView>
1919
// <TabView.items>
20-
// <TabEntry title="Tab 1">
21-
// <TabEntry.view>
20+
// <TabViewItem title="Tab 1">
21+
// <TabViewItem.view>
2222
// <Label text="Label in Tab1" />
23-
// </TabEntry.view>
24-
// </TabEntry>
25-
// <TabEntry title="Tab 2">
26-
// <TabEntry.view>
23+
// </TabViewItem.view>
24+
// </TabViewItem>
25+
// <TabViewItem title="Tab 2">
26+
// <TabViewItem.view>
2727
// <Label text="Label in Tab2" />
28-
// </TabEntry.view>
29-
// </TabEntry>
28+
// </TabViewItem.view>
29+
// </TabViewItem>
3030
// </TabView.items>
3131
// </TabView>
3232
// </Page>
@@ -47,8 +47,8 @@ function _createTabView(): tabViewModule.TabView {
4747
return tabView;
4848
}
4949

50-
function _createItems(count: number): Array<tabViewModule.TabEntry> {
51-
var items = new Array<tabViewModule.TabEntry>();
50+
function _createItems(count: number): Array<tabViewModule.TabViewItem> {
51+
var items = new Array<tabViewModule.TabViewItem>();
5252
for (var i = 0; i < count; i++) {
5353
var label = new labelModule.Label();
5454
label.text = "Tab " + i;
@@ -263,7 +263,7 @@ export var testBindingToTabEntryWithUndefinedViewShouldThrow = function () {
263263
var tabView = <tabViewModule.TabView>views[0];
264264
TKUnit.assertThrows(function () {
265265
tabView.items = [{ title: "Tab 0", view: undefined }];
266-
}, "Binding TabView to a TabEntry with undefined view should throw.");
266+
}, "Binding TabView to a TabViewItem with undefined view should throw.");
267267
});
268268
}
269269

@@ -273,7 +273,7 @@ export var testBindingToTabEntryWithNullViewShouldThrow = function () {
273273
var tabView = <tabViewModule.TabView>views[0];
274274
TKUnit.assertThrows(function () {
275275
tabView.items = [{ title: "Tab 0", view: null }];
276-
}, "Binding TabView to a TabEntry with null view should throw.");
276+
}, "Binding TabView to a TabViewItem with null view should throw.");
277277
});
278278
}
279279

apps/tests/xml-declaration/mainPage.xml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
xmlns:customControls2="app/xml-declaration/mymodulewithxml">
44
<TabView>
55
<TabView.items>
6-
<TabEntry title="Tab 1">
7-
<TabEntry.view>
6+
<TabViewItem title="Tab 1">
7+
<TabViewItem.view>
88
<StackLayout>
99

1010
<SegmentedBar selectedIndex="1" style="background-color: red; color: white" selectedBackgroundColor="green">
@@ -38,25 +38,25 @@
3838
<Button text="This is Button!" tap="buttonTap" />
3939
<customControls:MyControl />
4040
</StackLayout>
41-
</TabEntry.view>
42-
</TabEntry>
43-
<TabEntry title="Tab 2">
44-
<TabEntry.view>
41+
</TabViewItem.view>
42+
</TabViewItem>
43+
<TabViewItem title="Tab 2">
44+
<TabViewItem.view>
4545
<StackLayout>
4646
<customControls2:MyControl />
4747
<Label text="This is Label in Tab 2" />
4848
</StackLayout>
49-
</TabEntry.view>
50-
</TabEntry>
51-
<TabEntry title="Tab 3">
52-
<TabEntry.view>
49+
</TabViewItem.view>
50+
</TabViewItem>
51+
<TabViewItem title="Tab 3">
52+
<TabViewItem.view>
5353
<GridLayout columns="50, auto, *" rows="50, auto, *">
5454
<Label text="This is Label in Tab 3" row="0" />
5555
<Label text="This is second Label in Tab 3" row="1" />
5656
<customControls:MyControl />
5757
</GridLayout>
58-
</TabEntry.view>
59-
</TabEntry>
58+
</TabViewItem.view>
59+
</TabViewItem>
6060
</TabView.items>
6161
</TabView>
6262
</Page>

ui/builder/component-builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ var MODULES = {
2323
"SearchBar": "ui/search-bar",
2424
"SlideOut": "ui/slide-out",
2525
"TabView": "ui/tab-view",
26-
"TabEntry": "ui/tab-view",
26+
"TabViewItem": "ui/tab-view",
2727
"TextField": "ui/text-field",
2828
"TextView": "ui/text-view",
2929
"FormattedString": "text/formatted-string",

ui/tab-view/tab-view-common.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ export class TabView extends view.View implements definition.TabView, view.AddAr
4949
}
5050
}
5151

52-
get items(): Array<definition.TabEntry> {
52+
get items(): Array<definition.TabViewItem> {
5353
return this._getValue(TabView.itemsProperty);
5454
}
55-
set items(value: Array<definition.TabEntry>) {
55+
set items(value: Array<definition.TabViewItem>) {
5656
this._setValue(TabView.itemsProperty, value);
5757
}
5858

@@ -84,24 +84,24 @@ export class TabView extends view.View implements definition.TabView, view.AddAr
8484
}
8585
}
8686

87-
public _removeTabs(oldItems: Array<definition.TabEntry>) {
87+
public _removeTabs(oldItems: Array<definition.TabViewItem>) {
8888
//
8989
}
9090

91-
public _addTabs(newItems: Array<definition.TabEntry>) {
91+
public _addTabs(newItems: Array<definition.TabViewItem>) {
9292
// Validate that all items are ok before the native _addTabs code runs.
9393
var i: number;
9494
var length = newItems.length;
95-
var newItem: definition.TabEntry;
95+
var newItem: definition.TabViewItem;
9696
for (i = 0; i < length; i++) {
9797
newItem = newItems[i];
9898

9999
if (!newItem) {
100-
throw new Error("TabEntry at index " + i + " is undefined.");
100+
throw new Error("TabViewItem at index " + i + " is undefined.");
101101
}
102102

103103
if (!newItem.view) {
104-
throw new Error("TabEntry at index " + i + " does not have a view.");
104+
throw new Error("TabViewItem at index " + i + " does not have a view.");
105105
}
106106
}
107107
}
@@ -163,7 +163,7 @@ export class TabView extends view.View implements definition.TabView, view.AddAr
163163

164164
var i;
165165
var length = _items.length;
166-
var item: definition.TabEntry;
166+
var item: definition.TabViewItem;
167167
var retVal: boolean;
168168

169169
for (i = 0; i < length; i++) {

ui/tab-view/tab-view.android.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ export class TabView extends common.TabView {
326326
}
327327
}
328328

329-
public _addTabs(newItems: Array<definition.TabEntry>) {
329+
public _addTabs(newItems: Array<definition.TabViewItem>) {
330330
trace.write("TabView._addTabs(" + newItems + ");", common.traceCategory);
331331
super._addTabs(newItems);
332332

@@ -351,7 +351,7 @@ export class TabView extends common.TabView {
351351
// TODO: Where will be the support for more ActionBar settings like Title, Navigation buttons, etc.?
352352
var i: number = 0;
353353
var length = newItems.length;
354-
var item: definition.TabEntry;
354+
var item: definition.TabViewItem;
355355
var tab: android.app.ActionBar.Tab;
356356

357357
for (i; i < length; i++) {
@@ -367,7 +367,7 @@ export class TabView extends common.TabView {
367367
}
368368
}
369369

370-
public _removeTabs(oldItems: Array<definition.TabEntry>) {
370+
public _removeTabs(oldItems: Array<definition.TabViewItem>) {
371371
trace.write("TabView._removeTabs(" + oldItems + ");", common.traceCategory);
372372
super._removeTabs(oldItems);
373373

ui/tab-view/tab-view.d.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ declare module "ui/tab-view" {
88
/**
99
* Represents a tab view entry.
1010
*/
11-
interface TabEntry {
11+
interface TabViewItem {
1212
/**
13-
* Gets or sets the title of the TabEntry.
13+
* Gets or sets the title of the TabViewItem.
1414
*/
1515
title: string;
16-
16+
1717
/**
18-
* Gets or sets the view of the TabEntry.
18+
* Gets or sets the view of the TabViewItem.
1919
*/
2020
view: view.View;
2121
}
@@ -24,13 +24,13 @@ declare module "ui/tab-view" {
2424
* Represents a tab view.
2525
*/
2626
class TabView extends view.View {
27-
public static itemsProperty : dependencyObservable.Property;
28-
public static selectedIndexProperty : dependencyObservable.Property;
27+
public static itemsProperty: dependencyObservable.Property;
28+
public static selectedIndexProperty: dependencyObservable.Property;
2929

3030
/**
3131
* Gets or sets the items of the TabView.
3232
*/
33-
items: Array<TabEntry>;
33+
items: Array<TabViewItem>;
3434

3535
/**
3636
* Gets or sets the selectedIndex of the TabView.

ui/tab-view/tab-view.ios.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,13 @@ export class TabView extends common.TabView {
117117
}
118118
}
119119

120-
public _removeTabs(oldItems: Array<definition.TabEntry>) {
120+
public _removeTabs(oldItems: Array<definition.TabViewItem>) {
121121
trace.write("TabView._removeTabs(" + oldItems + ");", trace.categories.Debug);
122122
super._removeTabs(oldItems);
123123

124124
var i: number;
125125
var length = oldItems.length;
126-
var oldItem: definition.TabEntry;
126+
var oldItem: definition.TabViewItem;
127127
for (i = 0; i < length; i++) {
128128
oldItem = oldItems[i];
129129
this._removeView(oldItem.view);
@@ -132,13 +132,13 @@ export class TabView extends common.TabView {
132132
this._ios.viewControllers = null;
133133
}
134134

135-
public _addTabs(newItems: Array<definition.TabEntry>) {
135+
public _addTabs(newItems: Array<definition.TabViewItem>) {
136136
trace.write("TabView._addTabs(" + newItems + ");", trace.categories.Debug);
137137
super._addTabs(newItems);
138138

139139
var i: number;
140140
var length = newItems.length;
141-
var newItem: definition.TabEntry;
141+
var newItem: definition.TabViewItem;
142142
var newControllers: NSMutableArray = NSMutableArray.alloc().initWithCapacity(length);
143143
var newController: UIViewController;
144144

0 commit comments

Comments
 (0)