mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Merge pull request #3332 from NativeScript/reexports
Comment out TabView where it does not compile
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"name": "tns-samples-apps",
|
||||
"main": "cuteness.io/app.js"
|
||||
"main": "ui-tests-app/app.js"
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
import { ad } from "utils/utils";
|
||||
|
||||
export * from "./editable-text-base-common";
|
||||
|
||||
@Interfaces([android.text.TextWatcher])
|
||||
class TextWatcher extends java.lang.Object implements android.text.TextWatcher {
|
||||
constructor(private owner: WeakRef<EditableTextBase>) {
|
||||
|
||||
@@ -227,46 +227,47 @@ export class TabView extends TabViewBase {
|
||||
}
|
||||
|
||||
public _onItemsPropertyChangedSetNativeValue() {
|
||||
let oldItems = <TabViewItem[]>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 = <TabViewItem[]>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 = <TabViewItem[]>this.items;
|
||||
if (items) {
|
||||
let tabItems = new Array<org.nativescript.widgets.TabItemSpec>();
|
||||
items.forEach((item, idx, arr) => {
|
||||
if (!item.view) {
|
||||
throw new Error("View of TabViewItem at index " + idx + " is " + item.view);
|
||||
}
|
||||
// let items = <TabViewItem[]>this.items;
|
||||
// if (items) {
|
||||
// let tabItems = new Array<org.nativescript.widgets.TabItemSpec>();
|
||||
// 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) {
|
||||
|
||||
@@ -400,15 +400,16 @@ export class TabView extends TabViewBase {
|
||||
}
|
||||
|
||||
private _onItemsPropertyChangedSetNativeValue() {
|
||||
let oldValue = <TabViewItem[]>this.previousItems;
|
||||
if (oldValue) {
|
||||
this._removeTabs(oldValue);
|
||||
}
|
||||
throw new Error("Compilation error: Can't find this.previousItems");
|
||||
// let oldValue = <TabViewItem[]>this.previousItems;
|
||||
// if (oldValue) {
|
||||
// this._removeTabs(oldValue);
|
||||
// }
|
||||
|
||||
let newValue = <TabViewItem[]>this.items;
|
||||
if (newValue) {
|
||||
this._addTabs(newValue);
|
||||
}
|
||||
// let newValue = <TabViewItem[]>this.items;
|
||||
// if (newValue) {
|
||||
// this._addTabs(newValue);
|
||||
// }
|
||||
}
|
||||
|
||||
get [selectedIndexProperty.native](): number {
|
||||
|
||||
@@ -3,10 +3,10 @@ import { EditableTextBase, Property, booleanConverter } from "ui/editable-text-b
|
||||
|
||||
export * from "ui/editable-text-base";
|
||||
|
||||
export const secureProperty = new Property<TextFieldBase, boolean>({ name: "secure", defaultValue: false, valueConverter: booleanConverter });
|
||||
secureProperty.register(TextFieldBase)
|
||||
|
||||
export class TextFieldBase extends EditableTextBase implements TextFieldDefinition {
|
||||
public static returnPressEvent = "returnPress";
|
||||
public secure: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
export const secureProperty = new Property<TextFieldBase, boolean>({ name: "secure", defaultValue: false, valueConverter: booleanConverter });
|
||||
secureProperty.register(TextFieldBase);
|
||||
Reference in New Issue
Block a user