From 3cfab990c4cc9544163532c238614b4680273c46 Mon Sep 17 00:00:00 2001 From: Rossen Hristov Date: Tue, 20 Dec 2016 14:23:37 +0200 Subject: [PATCH] Comment out TabView which does not compile --- apps/app/package.json | 2 +- .../ui/tab-view/tab-view.android.ts | 69 ++++++++++--------- tns-core-modules/ui/tab-view/tab-view.ios.ts | 17 ++--- 3 files changed, 45 insertions(+), 43 deletions(-) diff --git a/apps/app/package.json b/apps/app/package.json index b83961d5d..711929cac 100644 --- a/apps/app/package.json +++ b/apps/app/package.json @@ -1,4 +1,4 @@ { "name": "tns-samples-apps", - "main": "cuteness.io/app.js" + "main": "ui-tests-app/app.js" } diff --git a/tns-core-modules/ui/tab-view/tab-view.android.ts b/tns-core-modules/ui/tab-view/tab-view.android.ts index 387b2d4e5..3fba3195b 100644 --- a/tns-core-modules/ui/tab-view/tab-view.android.ts +++ b/tns-core-modules/ui/tab-view/tab-view.android.ts @@ -227,46 +227,47 @@ export class TabView extends TabViewBase { } public _onItemsPropertyChangedSetNativeValue() { - let oldItems = this.previousItems; - if (oldItems) { - oldItems.forEach((oldItem) => { - // _removeView is called within destroyItem method - oldItem._parent = null; - }); + throw new Error("Compilation error: Can't find this.previousItems"); + // let oldItems = this.previousItems; + // if (oldItems) { + // oldItems.forEach((oldItem) => { + // // _removeView is called within destroyItem method + // oldItem._parent = null; + // }); - this._viewPager.setAdapter(null); - this._pagerAdapter = null; - this._tabLayout.setItems(null, null); - } + // this._viewPager.setAdapter(null); + // this._pagerAdapter = null; + // this._tabLayout.setItems(null, null); + // } - let items = this.items; - if (items) { - let tabItems = new Array(); - items.forEach((item, idx, arr) => { - if (!item.view) { - throw new Error("View of TabViewItem at index " + idx + " is " + item.view); - } + // let items = this.items; + // if (items) { + // let tabItems = new Array(); + // items.forEach((item, idx, arr) => { + // if (!item.view) { + // throw new Error("View of TabViewItem at index " + idx + " is " + item.view); + // } - item._parent = this; - if (item.view.parent !== this) { - this._addView(item.view, idx); - } - tabItems.push(this.createTabItem(item)); - }); + // item._parent = this; + // if (item.view.parent !== this) { + // this._addView(item.view, idx); + // } + // tabItems.push(this.createTabItem(item)); + // }); - ensurePagerAdapterClass(); - // TODO: optimize by reusing the adapter and calling setAdapter(null) then the same adapter. - this._pagerAdapter = new PagerAdapterClass(this, items); - this._viewPager.setAdapter(this._pagerAdapter); + // ensurePagerAdapterClass(); + // // TODO: optimize by reusing the adapter and calling setAdapter(null) then the same adapter. + // this._pagerAdapter = new PagerAdapterClass(this, items); + // this._viewPager.setAdapter(this._pagerAdapter); - this._tabLayout.setItems(tabItems, this._viewPager); - } + // this._tabLayout.setItems(tabItems, this._viewPager); + // } - let nativeSelectedIndex = this._viewPager.getCurrentItem(); - let selectedIndex = this.selectedIndex; - if (selectedIndex < 0) { - this.selectedIndex = nativeSelectedIndex; - } + // let nativeSelectedIndex = this._viewPager.getCurrentItem(); + // let selectedIndex = this.selectedIndex; + // if (selectedIndex < 0) { + // this.selectedIndex = nativeSelectedIndex; + // } } public _updateTabForItem(item: TabViewItem) { diff --git a/tns-core-modules/ui/tab-view/tab-view.ios.ts b/tns-core-modules/ui/tab-view/tab-view.ios.ts index b8fc2fd06..93832777a 100644 --- a/tns-core-modules/ui/tab-view/tab-view.ios.ts +++ b/tns-core-modules/ui/tab-view/tab-view.ios.ts @@ -400,15 +400,16 @@ export class TabView extends TabViewBase { } private _onItemsPropertyChangedSetNativeValue() { - let oldValue = this.previousItems; - if (oldValue) { - this._removeTabs(oldValue); - } + throw new Error("Compilation error: Can't find this.previousItems"); + // let oldValue = this.previousItems; + // if (oldValue) { + // this._removeTabs(oldValue); + // } - let newValue = this.items; - if (newValue) { - this._addTabs(newValue); - } + // let newValue = this.items; + // if (newValue) { + // this._addTabs(newValue); + // } } get [selectedIndexProperty.native](): number {