Skip to content

Commit fda4f74

Browse files
committed
fix(android): regression fixes
1 parent 7664ca0 commit fda4f74

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

src/collectionview/index.android.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ export class CollectionView extends CollectionViewBase {
154154
scrolling = false;
155155
needsScrollStartEvent = false;
156156

157-
private static _hlayoutParams: android.view.ViewGroup.LayoutParams;
158-
private static _vlayoutParams: android.view.ViewGroup.LayoutParams;
157+
private _hlayoutParams: android.view.ViewGroup.LayoutParams;
158+
private _vlayoutParams: android.view.ViewGroup.LayoutParams;
159159
private _lastLayoutKey: string;
160160

161161
private _listViewAdapter: com.nativescript.collectionview.Adapter;
@@ -280,7 +280,6 @@ export class CollectionView extends CollectionViewBase {
280280
onMeasure: () => this.updateInnerSize()
281281
});
282282
this.spanSize = this._getSpanSize;
283-
284283
this.refresh();
285284
}
286285
@profile
@@ -473,17 +472,17 @@ export class CollectionView extends CollectionViewBase {
473472
}
474473
_getViewLayoutParams() {
475474
if (this.isHorizontal()) {
476-
if (!CollectionView._hlayoutParams) {
475+
if (!this._hlayoutParams) {
477476
LayoutParams = LayoutParams || android.view.ViewGroup.LayoutParams;
478-
CollectionView._hlayoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
477+
this._hlayoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
479478
}
480-
return CollectionView._hlayoutParams;
479+
return this._hlayoutParams;
481480
} else {
482-
if (!CollectionView._vlayoutParams) {
481+
if (!this._vlayoutParams) {
483482
LayoutParams = LayoutParams || android.view.ViewGroup.LayoutParams;
484-
CollectionView._vlayoutParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
483+
this._vlayoutParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
485484
}
486-
return CollectionView._vlayoutParams;
485+
return this._vlayoutParams;
487486
}
488487
}
489488

@@ -897,10 +896,12 @@ export class CollectionView extends CollectionViewBase {
897896
if (!view) {
898897
return;
899898
}
900-
if (!this.isLoaded || this._innerWidth === 0 || this._innerHeight === 0) {
901-
this._isDataDirty = true;
902-
return;
903-
}
899+
// seems like we refresh sooner
900+
// not sure why it was needed before and not now.
901+
// if (!this.isLoaded || this._innerWidth === 0 || this._innerHeight === 0) {
902+
// this._isDataDirty = true;
903+
// return;
904+
// }
904905
this._isDataDirty = false;
905906
this._lastLayoutKey = this._innerWidth + '_' + this._innerHeight;
906907
let adapter = this._listViewAdapter;

0 commit comments

Comments
 (0)