mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 12:57:42 +08:00
Comment out TabView which does not compile
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"name": "tns-samples-apps",
|
"name": "tns-samples-apps",
|
||||||
"main": "cuteness.io/app.js"
|
"main": "ui-tests-app/app.js"
|
||||||
}
|
}
|
||||||
|
@ -227,46 +227,47 @@ export class TabView extends TabViewBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public _onItemsPropertyChangedSetNativeValue() {
|
public _onItemsPropertyChangedSetNativeValue() {
|
||||||
let oldItems = <TabViewItem[]>this.previousItems;
|
throw new Error("Compilation error: Can't find this.previousItems");
|
||||||
if (oldItems) {
|
// let oldItems = <TabViewItem[]>this.previousItems;
|
||||||
oldItems.forEach((oldItem) => {
|
// if (oldItems) {
|
||||||
// _removeView is called within destroyItem method
|
// oldItems.forEach((oldItem) => {
|
||||||
oldItem._parent = null;
|
// // _removeView is called within destroyItem method
|
||||||
});
|
// oldItem._parent = null;
|
||||||
|
// });
|
||||||
|
|
||||||
this._viewPager.setAdapter(null);
|
// this._viewPager.setAdapter(null);
|
||||||
this._pagerAdapter = null;
|
// this._pagerAdapter = null;
|
||||||
this._tabLayout.setItems(null, null);
|
// this._tabLayout.setItems(null, null);
|
||||||
}
|
// }
|
||||||
|
|
||||||
let items = <TabViewItem[]>this.items;
|
// let items = <TabViewItem[]>this.items;
|
||||||
if (items) {
|
// if (items) {
|
||||||
let tabItems = new Array<org.nativescript.widgets.TabItemSpec>();
|
// let tabItems = new Array<org.nativescript.widgets.TabItemSpec>();
|
||||||
items.forEach((item, idx, arr) => {
|
// items.forEach((item, idx, arr) => {
|
||||||
if (!item.view) {
|
// if (!item.view) {
|
||||||
throw new Error("View of TabViewItem at index " + idx + " is " + item.view);
|
// throw new Error("View of TabViewItem at index " + idx + " is " + item.view);
|
||||||
}
|
// }
|
||||||
|
|
||||||
item._parent = this;
|
// item._parent = this;
|
||||||
if (item.view.parent !== this) {
|
// if (item.view.parent !== this) {
|
||||||
this._addView(item.view, idx);
|
// this._addView(item.view, idx);
|
||||||
}
|
// }
|
||||||
tabItems.push(this.createTabItem(item));
|
// tabItems.push(this.createTabItem(item));
|
||||||
});
|
// });
|
||||||
|
|
||||||
ensurePagerAdapterClass();
|
// ensurePagerAdapterClass();
|
||||||
// TODO: optimize by reusing the adapter and calling setAdapter(null) then the same adapter.
|
// // TODO: optimize by reusing the adapter and calling setAdapter(null) then the same adapter.
|
||||||
this._pagerAdapter = new PagerAdapterClass(this, items);
|
// this._pagerAdapter = new PagerAdapterClass(this, items);
|
||||||
this._viewPager.setAdapter(this._pagerAdapter);
|
// this._viewPager.setAdapter(this._pagerAdapter);
|
||||||
|
|
||||||
this._tabLayout.setItems(tabItems, this._viewPager);
|
// this._tabLayout.setItems(tabItems, this._viewPager);
|
||||||
}
|
// }
|
||||||
|
|
||||||
let nativeSelectedIndex = this._viewPager.getCurrentItem();
|
// let nativeSelectedIndex = this._viewPager.getCurrentItem();
|
||||||
let selectedIndex = this.selectedIndex;
|
// let selectedIndex = this.selectedIndex;
|
||||||
if (selectedIndex < 0) {
|
// if (selectedIndex < 0) {
|
||||||
this.selectedIndex = nativeSelectedIndex;
|
// this.selectedIndex = nativeSelectedIndex;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public _updateTabForItem(item: TabViewItem) {
|
public _updateTabForItem(item: TabViewItem) {
|
||||||
|
@ -400,15 +400,16 @@ export class TabView extends TabViewBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _onItemsPropertyChangedSetNativeValue() {
|
private _onItemsPropertyChangedSetNativeValue() {
|
||||||
let oldValue = <TabViewItem[]>this.previousItems;
|
throw new Error("Compilation error: Can't find this.previousItems");
|
||||||
if (oldValue) {
|
// let oldValue = <TabViewItem[]>this.previousItems;
|
||||||
this._removeTabs(oldValue);
|
// if (oldValue) {
|
||||||
}
|
// this._removeTabs(oldValue);
|
||||||
|
// }
|
||||||
|
|
||||||
let newValue = <TabViewItem[]>this.items;
|
// let newValue = <TabViewItem[]>this.items;
|
||||||
if (newValue) {
|
// if (newValue) {
|
||||||
this._addTabs(newValue);
|
// this._addTabs(newValue);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
get [selectedIndexProperty.native](): number {
|
get [selectedIndexProperty.native](): number {
|
||||||
|
Reference in New Issue
Block a user