Removed the code that raises 'unloaded' event for list-view rows for performance reasons.

This commit is contained in:
Rossen Hristov
2015-07-31 09:30:42 +03:00
parent 56760e364d
commit 18d3d5fea4
2 changed files with 0 additions and 35 deletions

View File

@ -34,7 +34,6 @@ export class ListView extends common.ListView {
private _android: android.widget.ListView;
public _realizedItems = {};
private _androidViewId: number;
public _attachStateChangeListener: android.view.View.OnAttachStateChangeListener;
public _createUI() {
this._android = new android.widget.ListView(this._context);
@ -89,28 +88,6 @@ export class ListView extends common.ListView {
}
}
}));
this._attachStateChangeListener = new android.view.View.OnAttachStateChangeListener({
get owner() {
return that.get();
},
onViewAttachedToWindow: function (view: android.view.View) {
//
},
onViewDetachedFromWindow: function (androidView: android.view.View) {
var owner = that.get();
if (!owner) {
return;
}
var view: viewModule.View = this.owner._realizedItems[androidView.hashCode()];
if (!view) {
return;
}
view.onUnloaded();
}
});
}
get android(): android.widget.ListView {
@ -234,10 +211,6 @@ class ListViewAdapter extends android.widget.BaseAdapter {
}
}
if (!this._listView._realizedItems[convertView.hashCode()]) {
convertView.addOnAttachStateChangeListener(this._listView._attachStateChangeListener);
}
this._listView._realizedItems[convertView.hashCode()] = args.view;
// cache the realized index (used to raise the ItemLoading event upon scroll stop)
args.view[REALIZED_INDEX] = index;

View File

@ -21,14 +21,6 @@ class ListViewCell extends UITableViewCell {
static new(): ListViewCell {
return <ListViewCell>super.new();
}
public removeFromSuperview(): void {
super.removeFromSuperview();
var view: view.View = (<any>this).view;
if (view) {
view.onUnloaded();
}
}
}
function notifyForItemAtIndex(listView: definition.ListView, cell: any, eventName: string, indexPath: NSIndexPath) {