@nativescript-community/ui-collectionview 5.3.6 → 5.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.android.js DELETED
@@ -1,1219 +0,0 @@
1
- var _a, _b;
2
- /* eslint-disable no-redeclare */
3
- import { ChangeType, ContentView, CoreTypes, Length, Property, ProxyViewContainer, Trace, Utils, View, ViewBase, booleanConverter, paddingBottomProperty, paddingLeftProperty, paddingRightProperty, paddingTopProperty, profile } from '@nativescript/core';
4
- import { itemOverlapProperty, reorderLongPressEnabledProperty, reorderingEnabledProperty, reverseLayoutProperty, scrollBarIndicatorVisibleProperty } from '.';
5
- import { CLog, CLogTypes, CollectionViewBase, ListViewViewTypes, isScrollEnabledProperty, orientationProperty } from './index-common';
6
- export * from './index-common';
7
- var SimpleCallback = /** @class */ (function (_super) {
8
- __extends(SimpleCallback, _super);
9
- function SimpleCallback(param1, param2) {
10
- var _this = _super.call(this, param1, param2) || this;
11
- _this.startPosition = -1;
12
- _this.endPosition = -1;
13
- return global.__native(_this);
14
- }
15
- SimpleCallback.prototype.onMove = function (recyclerview, viewHolder, target) {
16
- var _a;
17
- var startPosition = viewHolder.getAdapterPosition();
18
- var endPosition = target.getAdapterPosition();
19
- if (this.startPosition === -1) {
20
- this.startPosition = startPosition;
21
- }
22
- this.endPosition = endPosition;
23
- var owner = (_a = this.owner) === null || _a === void 0 ? void 0 : _a.get();
24
- if (owner) {
25
- owner._reorderItemInSource(startPosition, endPosition);
26
- return true;
27
- }
28
- return false;
29
- };
30
- SimpleCallback.prototype.onSelectedChanged = function (viewHolder, state) {
31
- var _a;
32
- if (viewHolder) {
33
- if (this.startPosition === -1) {
34
- this.startPosition = viewHolder.getAdapterPosition();
35
- }
36
- }
37
- if (!viewHolder) {
38
- // this is where we identify the end of the drag and call the end event
39
- var owner = (_a = this.owner) === null || _a === void 0 ? void 0 : _a.get();
40
- if (this.endPosition === -1) {
41
- this.endPosition = this.startPosition;
42
- }
43
- if (owner) {
44
- var item = owner.getItemAtIndex(this.startPosition);
45
- owner._callItemReorderedEvent(this.startPosition, this.endPosition, item);
46
- }
47
- this.startPosition = -1;
48
- this.endPosition = -1;
49
- owner.isDragging = false;
50
- }
51
- };
52
- SimpleCallback.prototype.onSwiped = function (viewHolder, direction) { };
53
- SimpleCallback.prototype.isItemViewSwipeEnabled = function () {
54
- // disabled for now
55
- return false;
56
- };
57
- SimpleCallback.prototype.isLongPressDragEnabled = function () {
58
- // we use our custom longpress gesture handler
59
- return false;
60
- };
61
- return SimpleCallback;
62
- }(androidx.recyclerview.widget.ItemTouchHelper.SimpleCallback));
63
- var LongPressGestureListenerImpl = /** @class */ (function (_super) {
64
- __extends(LongPressGestureListenerImpl, _super);
65
- function LongPressGestureListenerImpl(_owner) {
66
- var _this = _super.call(this) || this;
67
- _this._owner = _owner;
68
- return global.__native(_this);
69
- }
70
- LongPressGestureListenerImpl.prototype.onLongPress = function (motionEvent) {
71
- var _a;
72
- var owner = (_a = this._owner) === null || _a === void 0 ? void 0 : _a.get();
73
- if (owner) {
74
- owner.onReorderLongPress(motionEvent);
75
- }
76
- };
77
- return LongPressGestureListenerImpl;
78
- }(android.view.GestureDetector.SimpleOnGestureListener));
79
- let LayoutParams;
80
- const extraLayoutSpaceProperty = new Property({
81
- name: 'extraLayoutSpace'
82
- });
83
- const itemViewCacheSizeProperty = new Property({
84
- name: 'itemViewCacheSize'
85
- });
86
- const nestedScrollingEnabledProperty = new Property({
87
- name: 'nestedScrollingEnabled',
88
- defaultValue: true,
89
- valueConverter: booleanConverter
90
- });
91
- export var SnapPosition;
92
- (function (SnapPosition) {
93
- SnapPosition[SnapPosition["START"] = 0] = "START";
94
- SnapPosition[SnapPosition["END"] = 1] = "END";
95
- })(SnapPosition || (SnapPosition = {}));
96
- export class CollectionView extends CollectionViewBase {
97
- constructor() {
98
- super(...arguments);
99
- this.templateTypeNumberString = new Map();
100
- this.templateStringTypeNumber = new Map();
101
- this._currentNativeItemType = 0;
102
- this.currentSpanCount = 1;
103
- // used to store viewHolder and thus their corresponding Views
104
- // used to "destroy" cells when possible
105
- this._viewHolders = new Set();
106
- this._scrollOrLoadMoreChangeCount = 0;
107
- this.scrolling = false;
108
- this.needsScrollStartEvent = false;
109
- this.animateItemUpdate = false;
110
- this.mInPropertiesSet = false;
111
- this.mShouldUpdateInnerSize = false;
112
- this.mShouldUpdateSpanCount = false;
113
- this.mShouldRefresh = false;
114
- this.defaultPoolSize = 10;
115
- this.desiredPoolSize = new Map();
116
- this.isDragging = false;
117
- this._layedOut = false;
118
- this.bindedViewHolders = new Set();
119
- }
120
- onResumeNativeUpdates() {
121
- // {N} suspends properties update on `_suspendNativeUpdates`. So we only need to do this in onResumeNativeUpdates
122
- this.mInPropertiesSet = true;
123
- super.onResumeNativeUpdates();
124
- this.mInPropertiesSet = false;
125
- if (this.mShouldUpdateInnerSize) {
126
- this.updateInnerSize();
127
- }
128
- if (this.mShouldUpdateSpanCount) {
129
- this.updateSpanCount();
130
- }
131
- if (this.mShouldRefresh) {
132
- this.refresh();
133
- }
134
- }
135
- createNativeView() {
136
- // storing the class in a property for reuse in the future cause a materializing which is pretty slow!
137
- if (!CollectionViewRecyclerView) {
138
- CollectionViewRecyclerView = com.nativescript.collectionview.RecyclerView;
139
- }
140
- const recyclerView = CollectionViewRecyclerView.createRecyclerView(this._context);
141
- // const expMgr = new RecyclerViewExpandableItemManager(null);
142
- // adapter.setDisplayHeadersAtStartUp(true).setStickyHeaders(true); //Make headers sticky
143
- // Endless scroll with 1 item threshold
144
- // .setLoadingMoreAtStartUp(true)
145
- // .setEndlessScrollListener(this, new ProgressItem())
146
- // .setEndlessScrollThreshold(1); //Default=1
147
- // const fastScroller = new com.l4digital.fastscroll.FastScroller(this._context);
148
- // fastScroller.setSectionIndexer(adapter);
149
- // fastScroller.attachRecyclerView(recyclerView);
150
- return recyclerView;
151
- }
152
- initNativeView() {
153
- super.initNativeView();
154
- const nativeView = this.nativeViewProtected;
155
- if (!this.recycledViewPool) {
156
- this.recycledViewPool = new com.nativescript.collectionview.RecycledViewPool();
157
- this.recycledViewPoolDisposeListener = new com.nativescript.collectionview.RecycledViewPool.ViewPoolListener({
158
- onViewHolderDisposed: (holder) => {
159
- if (Trace.isEnabled()) {
160
- CLog(CLogTypes.log, 'onViewHolderDisposed', holder);
161
- }
162
- if (this._viewHolders) {
163
- this._viewHolders.delete(holder);
164
- }
165
- const isNonSync = holder['defaultItemView'] === true;
166
- const view = isNonSync ? holder.view.content : holder.view;
167
- this.notifyForItemAtIndex(CollectionViewBase.itemDisposingEvent, view, holder.getAdapterPosition(), view.bindingContext, holder);
168
- if (view && view.isLoaded) {
169
- view.callUnloaded();
170
- }
171
- view._isAddedToNativeVisualTree = false;
172
- //@ts-ignore
173
- view.parent = null;
174
- view._tearDownUI();
175
- }
176
- });
177
- this.recycledViewPool.mListener = this.recycledViewPoolDisposeListener;
178
- }
179
- if (Trace.isEnabled() || this.hasListeners(CollectionViewBase.itemRecyclingEvent)) {
180
- const recyclerListener = (this.recyclerListener = new androidx.recyclerview.widget.RecyclerView.RecyclerListener({
181
- onViewRecycled: (holder) => {
182
- if (Trace.isEnabled()) {
183
- CLog(CLogTypes.log, 'onViewRecycled', this, nativeView, holder);
184
- }
185
- const isNonSync = holder['defaultItemView'] === true;
186
- const view = isNonSync ? holder.view.content : holder.view;
187
- this.notifyForItemAtIndex(CollectionViewBase.itemRecyclingEvent, view, holder.getAdapterPosition(), view.bindingContext, holder);
188
- }
189
- }));
190
- nativeView.setRecyclerListener(recyclerListener);
191
- }
192
- nativeView.setRecycledViewPool(this.recycledViewPool);
193
- let layoutManager;
194
- if (CollectionViewBase.layoutStyles[this.layoutStyle]) {
195
- layoutManager = CollectionViewBase.layoutStyles[this.layoutStyle].createLayout(this);
196
- }
197
- else {
198
- layoutManager = new com.nativescript.collectionview.PreCachingGridLayoutManager(this._context, 1);
199
- if (this.hasListeners(CollectionView.layoutCompletedEvent)) {
200
- layoutManager.layoutCompletedListener = new com.nativescript.collectionview.GridLayoutManager.LayoutCompletedListener({
201
- onLayoutCompleted: () => {
202
- this.notify({ eventName: CollectionView.layoutCompletedEvent });
203
- }
204
- });
205
- }
206
- // layoutManager = new PreCachingGridLayoutManager(this._context, 1);
207
- // (layoutManager as any).owner = new WeakRef(this);
208
- }
209
- // this.spanSize
210
- nativeView.setLayoutManager(layoutManager);
211
- nativeView.layoutManager = layoutManager;
212
- nativeView.sizeChangedListener = new com.nativescript.collectionview.SizeChangedListener({
213
- onLayout: (changed, left, top, right, bottom) => changed && this.onLayout(left, top, right, bottom),
214
- onMeasure: (widthMeasureSpec, heightMeasureSpec) => this.onMeasure(widthMeasureSpec, heightMeasureSpec)
215
- });
216
- this.spanSize = this._getSpanSize;
217
- // const animator = new jp.wasabeef.recyclerview.animators.FadeInAnimator();
218
- // // animator.setInterpolator(new android.view.animation.OvershootInterpolator());
219
- // animator.setMoveDuration(200);
220
- // Change animations are enabled by default since support-v7-recyclerview v22.
221
- // Need to disable them when using animation indicator.
222
- // animator.setSupportsChangeAnimations(false);
223
- // nativeView.setItemAnimator(animator);
224
- // enforce the first refresh for the collectionview to be ready as soon as possible
225
- this.refresh(true);
226
- }
227
- disposeNativeView() {
228
- // this.eachChildView((view) => {
229
- // view.parent._removeView(view);
230
- // return true;
231
- // });
232
- // this._realizedItems.clear();
233
- const nativeView = this.nativeViewProtected;
234
- nativeView.setRecyclerListener(null);
235
- nativeView.setRecycledViewPool(null);
236
- this.recycledViewPoolDisposeListener = null;
237
- this.recycledViewPool = null;
238
- if (nativeView.scrollListener) {
239
- this.nativeView.removeOnScrollListener(nativeView.scrollListener);
240
- nativeView.scrollListener = null;
241
- this._nScrollListener = null;
242
- }
243
- nativeView.sizeChangedListener = null;
244
- nativeView.layoutManager = null;
245
- this._listViewAdapter = null;
246
- this._itemTouchHelper = null;
247
- this._simpleItemTouchCallback = null;
248
- this.disposeViewHolderViews();
249
- this.clearTemplateTypes();
250
- super.disposeNativeView();
251
- }
252
- onLoaded() {
253
- super.onLoaded();
254
- this.attachScrollListener();
255
- // this.refresh();
256
- }
257
- getViewForItemAtIndex(index) {
258
- return this.enumerateViewHolders((v) => (v.getAdapterPosition() === index ? v.view : undefined));
259
- }
260
- //@ts-ignore
261
- set spanSize(inter) {
262
- if (!(typeof inter === 'function')) {
263
- return;
264
- }
265
- this._getSpanSize = inter;
266
- const layoutManager = this.layoutManager;
267
- if (layoutManager && layoutManager['setSpanSizeLookup']) {
268
- if (inter) {
269
- layoutManager['setSpanSizeLookup'](new com.nativescript.collectionview.SpanSizeLookup(new com.nativescript.collectionview.SpanSizeLookup.Interface({
270
- getSpanSize: (position) => {
271
- const dataItem = this.getItemAtIndex(position);
272
- return Math.min(inter(dataItem, position), this.currentSpanCount);
273
- }
274
- })));
275
- }
276
- else {
277
- layoutManager['setSpanSizeLookup'](null);
278
- }
279
- }
280
- }
281
- get spanSize() {
282
- return this._getSpanSize;
283
- }
284
- attachScrollListener() {
285
- if (this._scrollOrLoadMoreChangeCount > 0 && this.isLoaded) {
286
- const nativeView = this.nativeViewProtected;
287
- if (!nativeView.scrollListener) {
288
- this._nScrollListener = new com.nativescript.collectionview.OnScrollListener.Listener({
289
- onScrollStateChanged: this.onScrollStateChanged.bind(this),
290
- onScrolled: this.onScrolled.bind(this)
291
- });
292
- const scrollListener = new com.nativescript.collectionview.OnScrollListener(this._nScrollListener);
293
- nativeView.addOnScrollListener(scrollListener);
294
- nativeView.scrollListener = scrollListener;
295
- }
296
- }
297
- }
298
- detachScrollListener() {
299
- if (this._scrollOrLoadMoreChangeCount === 0 && this.isLoaded) {
300
- const nativeView = this.nativeViewProtected;
301
- if (nativeView.scrollListener) {
302
- this.nativeView.removeOnScrollListener(nativeView.scrollListener);
303
- nativeView.scrollListener = null;
304
- this._nScrollListener = null;
305
- }
306
- }
307
- }
308
- computeScrollEventData(view, eventName, dx, dy) {
309
- const horizontal = this.isHorizontal();
310
- const offset = horizontal ? view.computeHorizontalScrollOffset() : view.computeVerticalScrollOffset();
311
- const range = horizontal ? view.computeHorizontalScrollRange() : view.computeVerticalScrollRange();
312
- const extent = horizontal ? view.computeHorizontalScrollExtent() : view.computeVerticalScrollExtent();
313
- return {
314
- object: this,
315
- eventName,
316
- scrollOffset: offset / Utils.layout.getDisplayDensity(),
317
- scrollOffsetPercentage: offset / (range - extent),
318
- dx,
319
- dy
320
- };
321
- }
322
- onScrolled(view, dx, dy) {
323
- if (!this || !this.scrolling) {
324
- return;
325
- }
326
- if (this.needsScrollStartEvent) {
327
- this.needsScrollStartEvent = false;
328
- if (this.hasListeners(CollectionViewBase.scrollStartEvent)) {
329
- this.notify(this.computeScrollEventData(view, CollectionViewBase.scrollStartEvent, dx, dy));
330
- }
331
- }
332
- if (this.hasListeners(CollectionViewBase.scrollEvent)) {
333
- this.notify(this.computeScrollEventData(view, CollectionViewBase.scrollEvent, dx, dy));
334
- }
335
- if (this.hasListeners(CollectionViewBase.loadMoreItemsEvent) && this.items) {
336
- const layoutManager = view.getLayoutManager();
337
- if (layoutManager['findLastCompletelyVisibleItemPosition']) {
338
- const lastVisibleItemPos = layoutManager['findLastCompletelyVisibleItemPosition']();
339
- const loadMoreItemIndex = this.items.length - this.loadMoreThreshold;
340
- if (lastVisibleItemPos === loadMoreItemIndex) {
341
- this.notify({ eventName: CollectionViewBase.loadMoreItemsEvent });
342
- }
343
- }
344
- else if (layoutManager['findLastCompletelyVisibleItemPositions'] && layoutManager['getSpanCount']) {
345
- let positions = Array.create('int', layoutManager['getSpanCount']());
346
- positions = layoutManager['findLastCompletelyVisibleItemPositions'](positions);
347
- let lastVisibleItemPos = 0;
348
- for (let i = 0; i < positions.length; i++) {
349
- if (positions[i] > lastVisibleItemPos) {
350
- lastVisibleItemPos = positions[i];
351
- }
352
- }
353
- const loadMoreItemIndex = this.items.length - this.loadMoreThreshold;
354
- if (lastVisibleItemPos >= loadMoreItemIndex) {
355
- this.notify({ eventName: CollectionViewBase.loadMoreItemsEvent });
356
- }
357
- }
358
- }
359
- }
360
- onScrollStateChanged(view, newState) {
361
- if (this.scrolling && newState === 0) {
362
- // SCROLL_STATE_IDLE
363
- this.scrolling = false;
364
- if (this.hasListeners(CollectionViewBase.scrollEndEvent)) {
365
- this.notify(this.computeScrollEventData(view, CollectionViewBase.scrollEndEvent));
366
- }
367
- }
368
- else if (!this.scrolling && newState === 1) {
369
- //SCROLL_STATE_DRAGGING
370
- this.needsScrollStartEvent = true;
371
- this.scrolling = true;
372
- }
373
- }
374
- addEventListener(arg, callback, thisArg) {
375
- super.addEventListener(arg, callback, thisArg);
376
- if (arg === CollectionViewBase.scrollEvent || arg === CollectionViewBase.scrollStartEvent || arg === CollectionViewBase.scrollEndEvent || arg === CollectionViewBase.loadMoreItemsEvent) {
377
- this._scrollOrLoadMoreChangeCount++;
378
- this.attachScrollListener();
379
- }
380
- }
381
- removeEventListener(arg, callback, thisArg) {
382
- super.removeEventListener(arg, callback, thisArg);
383
- if (arg === CollectionViewBase.scrollEvent || arg === CollectionViewBase.scrollStartEvent || arg === CollectionViewBase.scrollEndEvent || arg === CollectionViewBase.loadMoreItemsEvent) {
384
- this._scrollOrLoadMoreChangeCount--;
385
- this.detachScrollListener();
386
- }
387
- }
388
- //@ts-ignore
389
- get android() {
390
- return this.nativeView;
391
- }
392
- get layoutManager() {
393
- return this.nativeViewProtected && this.nativeViewProtected.layoutManager;
394
- }
395
- _getViewLayoutParams() {
396
- if (this.isHorizontal()) {
397
- if (!this._hlayoutParams) {
398
- LayoutParams = LayoutParams || android.view.ViewGroup.LayoutParams;
399
- this._hlayoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT);
400
- }
401
- return this._hlayoutParams;
402
- }
403
- else {
404
- if (!this._vlayoutParams) {
405
- LayoutParams = LayoutParams || android.view.ViewGroup.LayoutParams;
406
- this._vlayoutParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
407
- }
408
- return this._vlayoutParams;
409
- }
410
- }
411
- setNativePoolSize(key, nativeIndex) {
412
- if (this.desiredPoolSize.has(key)) {
413
- this.nativeViewProtected.getRecycledViewPool().setMaxRecycledViews(nativeIndex, this.desiredPoolSize.get(key));
414
- }
415
- else {
416
- if (this.defaultPoolSize >= 0) {
417
- this.nativeViewProtected.getRecycledViewPool().setMaxRecycledViews(nativeIndex, this.defaultPoolSize);
418
- }
419
- }
420
- }
421
- setPoolSizes() {
422
- if (!this.nativeViewProtected || !this.templateTypeNumberString) {
423
- return;
424
- }
425
- this.desiredPoolSize.forEach((v, k) => {
426
- if (this.templateTypeNumberString.has(k)) {
427
- this.nativeViewProtected.getRecycledViewPool().setMaxRecycledViews(this.templateTypeNumberString.get(k), v);
428
- }
429
- });
430
- }
431
- setPoolSize(key, size) {
432
- this.desiredPoolSize.set(key, size);
433
- this.setPoolSizes();
434
- }
435
- [paddingTopProperty.getDefault]() {
436
- return { value: this._defaultPaddingTop, unit: 'px' };
437
- }
438
- [paddingTopProperty.setNative](value) {
439
- this._setPadding({ top: this.effectivePaddingTop });
440
- }
441
- [paddingRightProperty.getDefault]() {
442
- return { value: this._defaultPaddingRight, unit: 'px' };
443
- }
444
- [paddingRightProperty.setNative](value) {
445
- this._setPadding({ right: this.effectivePaddingRight });
446
- }
447
- [paddingBottomProperty.getDefault]() {
448
- return { value: this._defaultPaddingBottom, unit: 'px' };
449
- }
450
- [paddingBottomProperty.setNative](value) {
451
- this._setPadding({ bottom: this.effectivePaddingBottom });
452
- }
453
- [paddingLeftProperty.getDefault]() {
454
- return { value: this._defaultPaddingLeft, unit: 'px' };
455
- }
456
- [paddingLeftProperty.setNative](value) {
457
- this._setPadding({ left: this.effectivePaddingLeft });
458
- }
459
- [itemOverlapProperty.setNative](value) {
460
- if (!this.decorator) {
461
- this.decorator = new com.nativescript.collectionview.OverlapDecoration();
462
- this.nativeViewProtected.addItemDecoration(this.decorator);
463
- }
464
- this.decorator.top = Length.toDevicePixels(value[0], 0);
465
- this.decorator.right = Length.toDevicePixels(value[1], 0);
466
- this.decorator.bottom = Length.toDevicePixels(value[2], 0);
467
- this.decorator.left = Length.toDevicePixels(value[3], 0);
468
- }
469
- [orientationProperty.getDefault]() {
470
- return 'vertical';
471
- }
472
- [orientationProperty.setNative](value) {
473
- const layoutManager = this.layoutManager;
474
- if (!layoutManager || !layoutManager['setOrientation']) {
475
- return;
476
- }
477
- if (this.isHorizontal()) {
478
- layoutManager['setOrientation'](0);
479
- }
480
- else {
481
- layoutManager['setOrientation'](1);
482
- }
483
- this.updateScrollBarVisibility(this.scrollBarIndicatorVisible);
484
- }
485
- [isScrollEnabledProperty.setNative](value) {
486
- const layoutManager = this.layoutManager;
487
- if (layoutManager && layoutManager.setScrollEnabled) {
488
- layoutManager.setScrollEnabled(value);
489
- }
490
- }
491
- [reverseLayoutProperty.setNative](value) {
492
- const layoutManager = this.layoutManager;
493
- if (layoutManager && layoutManager.setReverseLayout) {
494
- layoutManager.setReverseLayout(value);
495
- // layoutManager['setStackFromEnd'](value);
496
- }
497
- }
498
- [nestedScrollingEnabledProperty.setNative](value) {
499
- this.nativeViewProtected.setNestedScrollingEnabled(value);
500
- }
501
- [extraLayoutSpaceProperty.setNative](value) {
502
- const layoutManager = this.layoutManager;
503
- if (layoutManager && layoutManager['setExtraLayoutSpace']) {
504
- layoutManager['setExtraLayoutSpace'](value);
505
- }
506
- }
507
- [itemViewCacheSizeProperty.setNative](value) {
508
- this.nativeViewProtected.setItemViewCacheSize(value);
509
- }
510
- [scrollBarIndicatorVisibleProperty.getDefault]() {
511
- return true;
512
- }
513
- [scrollBarIndicatorVisibleProperty.setNative](value) {
514
- this.updateScrollBarVisibility(value);
515
- }
516
- updateScrollBarVisibility(value) {
517
- if (!this.nativeViewProtected) {
518
- return;
519
- }
520
- if (this.orientation === 'horizontal') {
521
- this.nativeViewProtected.setHorizontalScrollBarEnabled(value);
522
- }
523
- else {
524
- this.nativeViewProtected.setVerticalScrollBarEnabled(value);
525
- }
526
- }
527
- enumerateViewHolders(cb) {
528
- let result, v;
529
- for (let it = this._viewHolders.values(), cellItemView = null; (cellItemView = it.next().value);) {
530
- if (cellItemView['position'] === undefined) {
531
- continue;
532
- }
533
- result = cb(cellItemView);
534
- if (result) {
535
- return result;
536
- }
537
- }
538
- return result;
539
- }
540
- startDragging(index) {
541
- if (this.reorderEnabled && this._itemTouchHelper) {
542
- // let viewHolder: CollectionViewCellHolder;
543
- const viewHolder = this.enumerateViewHolders((v) => (v.getAdapterPosition() === index ? v : undefined));
544
- if (viewHolder) {
545
- this.startViewHolderDragging(index, viewHolder);
546
- }
547
- }
548
- }
549
- startViewHolderDragging(index, viewHolder) {
550
- // isDragging is to prevent longPress from triggering and starting a new drag
551
- // when triggered manually
552
- if (!this.isDragging && this.shouldMoveItemAtIndex(index)) {
553
- this.isDragging = true;
554
- this._itemTouchHelper.startDrag(viewHolder);
555
- }
556
- }
557
- onReorderLongPress(motionEvent) {
558
- const collectionView = this.nativeViewProtected;
559
- if (!collectionView) {
560
- return;
561
- }
562
- const view = collectionView.findChildViewUnder(motionEvent.getX(), motionEvent.getY());
563
- const viewHolder = view != null ? collectionView.getChildViewHolder(view) : null;
564
- if (viewHolder) {
565
- this.startViewHolderDragging(viewHolder.getAdapterPosition(), viewHolder);
566
- }
567
- }
568
- _reorderItemInSource(oldPosition, newPosition) {
569
- const adapter = this._listViewAdapter;
570
- // 3. Tell adapter to render the model update.
571
- adapter.notifyItemMoved(oldPosition, newPosition);
572
- // on android _reorderItemInSource is call on every "move" and needs to update the adapter/items
573
- // we will call events only at then end
574
- super._reorderItemInSource(oldPosition, newPosition, false);
575
- }
576
- [_a = reorderLongPressEnabledProperty.setNative](value) {
577
- if (value) {
578
- if (!this._longPressGesture) {
579
- this._longPressGesture = new androidx.core.view.GestureDetectorCompat(this._context, new LongPressGestureListenerImpl(new WeakRef(this)));
580
- this._itemTouchListerner = new androidx.recyclerview.widget.RecyclerView.OnItemTouchListener({
581
- onInterceptTouchEvent: (view, event) => {
582
- if (this.reorderEnabled && this._longPressGesture) {
583
- this._longPressGesture.onTouchEvent(event);
584
- }
585
- return false;
586
- },
587
- onTouchEvent: (param0, param1) => { },
588
- onRequestDisallowInterceptTouchEvent: (disallowIntercept) => { }
589
- });
590
- }
591
- this.nativeViewProtected.addOnItemTouchListener(this._itemTouchListerner);
592
- }
593
- else {
594
- if (this._itemTouchListerner) {
595
- this.nativeViewProtected.removeOnItemTouchListener(this._itemTouchListerner);
596
- }
597
- }
598
- }
599
- [_b = reorderingEnabledProperty.setNative](value) {
600
- if (value) {
601
- if (!this._simpleItemTouchCallback) {
602
- const ItemTouchHelper = androidx.recyclerview.widget.ItemTouchHelper;
603
- this._simpleItemTouchCallback = new SimpleCallback(ItemTouchHelper.UP | ItemTouchHelper.DOWN | ItemTouchHelper.START | ItemTouchHelper.END, 0);
604
- this._simpleItemTouchCallback.owner = new WeakRef(this);
605
- this._itemTouchHelper = new androidx.recyclerview.widget.ItemTouchHelper(this._simpleItemTouchCallback);
606
- this._itemTouchHelper.attachToRecyclerView(this.nativeViewProtected);
607
- }
608
- }
609
- }
610
- onItemViewLoaderChanged() {
611
- if (this.itemViewLoader) {
612
- this.refresh();
613
- }
614
- }
615
- onItemTemplateSelectorChanged(oldValue, newValue) {
616
- super.onItemTemplateSelectorChanged(oldValue, newValue);
617
- this.clearTemplateTypes();
618
- this.refresh();
619
- }
620
- onItemTemplateChanged(oldValue, newValue) {
621
- super.onItemTemplateChanged(oldValue, newValue); // TODO: update current template with the new one
622
- this.refresh();
623
- }
624
- onItemTemplatesChanged(oldValue, newValue) {
625
- super.onItemTemplatesChanged(oldValue, newValue); // TODO: update current template with the new one
626
- this.refresh();
627
- }
628
- updateSpanCount(requestLayout = true) {
629
- if (this.mInPropertiesSet) {
630
- this.mShouldUpdateSpanCount = true;
631
- return false;
632
- }
633
- this.mShouldUpdateSpanCount = false;
634
- const layoutManager = this.layoutManager;
635
- if (layoutManager && layoutManager['setSpanCount']) {
636
- const newValue = (this.currentSpanCount = this.computeSpanCount());
637
- if (newValue !== layoutManager['getSpanCount']()) {
638
- layoutManager['setSpanCount'](newValue);
639
- if (requestLayout) {
640
- layoutManager.requestLayout();
641
- }
642
- return true;
643
- }
644
- }
645
- return false;
646
- }
647
- updateInnerSize() {
648
- if (this.mInPropertiesSet) {
649
- this.mShouldUpdateInnerSize = true;
650
- return false;
651
- }
652
- this.mShouldUpdateInnerSize = false;
653
- const result = super.updateInnerSize();
654
- if (result) {
655
- this.updateSpanCount();
656
- }
657
- // there is no need to call refresh if it was triggered before with same size.
658
- // this refresh is just to handle size change
659
- const layoutKey = this._innerWidth + '_' + this._innerHeight;
660
- if (this._isDataDirty || (this._lastLayoutKey && this._lastLayoutKey !== layoutKey)) {
661
- // setTimeout(() => this.refresh(false), 0);
662
- }
663
- this._lastLayoutKey = layoutKey;
664
- return result;
665
- }
666
- _onColWidthPropertyChanged(oldValue, newValue) {
667
- this.updateSpanCount();
668
- super._onColWidthPropertyChanged(oldValue, newValue);
669
- }
670
- _onRowHeightPropertyChanged(oldValue, newValue) {
671
- this.updateSpanCount();
672
- super._onRowHeightPropertyChanged(oldValue, newValue);
673
- }
674
- onLayout(left, top, right, bottom) {
675
- this._layedOut = true;
676
- // super.onLayout(left, top, right, bottom);
677
- const p = CollectionViewBase.plugins[this.layoutStyle];
678
- if (p && p.onLayout) {
679
- p.onLayout(this, left, top, right, bottom);
680
- }
681
- this.plugins.forEach((k) => {
682
- const p = CollectionViewBase.plugins[k];
683
- p.onLayout && p.onLayout(this, left, top, right, bottom);
684
- });
685
- }
686
- onMeasure(widthMeasureSpec, heightMeasureSpec) {
687
- const lastLayoutKey = this._lastLayoutKey;
688
- this.updateInnerSize();
689
- if (lastLayoutKey !== this._lastLayoutKey) {
690
- //we need to refresh visible cells so that they measure to the new size
691
- // for some reason it gets animated even with setSupportsChangeAnimations(false)
692
- // so we clear until it is done
693
- const nativeView = this.nativeViewProtected;
694
- const animator = nativeView.getItemAnimator();
695
- nativeView.setItemAnimator(null);
696
- this.refreshVisibleItems();
697
- setTimeout(() => {
698
- nativeView.setItemAnimator(animator);
699
- }, 0);
700
- }
701
- const p = CollectionViewBase.plugins[this.layoutStyle];
702
- if (p && p.onMeasure) {
703
- p.onMeasure(this, widthMeasureSpec, heightMeasureSpec);
704
- }
705
- this.plugins.forEach((k) => {
706
- const p = CollectionViewBase.plugins[k];
707
- p.onMeasure && p.onMeasure(this, widthMeasureSpec, heightMeasureSpec);
708
- });
709
- }
710
- onSourceCollectionChanged(event) {
711
- if (!this._listViewAdapter || this._dataUpdatesSuspended) {
712
- return;
713
- }
714
- if (Trace.isEnabled()) {
715
- CLog(CLogTypes.log, 'onItemsChanged', event.action, event.index, event.addedCount, event.removed, event.removed && event.removed.length);
716
- }
717
- switch (event.action) {
718
- case ChangeType.Delete: {
719
- this._listViewAdapter.notifyItemRangeRemoved(event.index, event.removed.length);
720
- return;
721
- }
722
- case ChangeType.Add: {
723
- if (event.addedCount > 0) {
724
- this._listViewAdapter.notifyItemRangeInserted(event.index, event.addedCount);
725
- }
726
- // Reload the items to avoid duplicate Load on Demand indicators:
727
- return;
728
- }
729
- case ChangeType.Update: {
730
- if (event.addedCount > 0) {
731
- this._listViewAdapter.notifyItemRangeChanged(event.index, event.addedCount);
732
- }
733
- return;
734
- }
735
- case ChangeType.Splice: {
736
- const added = event.addedCount;
737
- const removed = (event.removed && event.removed.length) || 0;
738
- if (added > 0 && added === removed) {
739
- // notifyItemRangeChanged wont create a fade effect
740
- if (!this.animateItemUpdate) {
741
- this._listViewAdapter.notifyItemRangeChanged(event.index, added);
742
- }
743
- else {
744
- this._listViewAdapter.notifyItemRangeRemoved(event.index, added);
745
- this._listViewAdapter.notifyItemRangeInserted(event.index, added);
746
- }
747
- }
748
- else {
749
- if (!this.animateItemUpdate) {
750
- if (added > removed) {
751
- if (removed > 0) {
752
- this._listViewAdapter.notifyItemRangeChanged(event.index, removed);
753
- }
754
- this._listViewAdapter.notifyItemRangeInserted(event.index + removed, added - removed);
755
- }
756
- else {
757
- if (added > 0) {
758
- this._listViewAdapter.notifyItemRangeChanged(event.index, added);
759
- }
760
- this._listViewAdapter.notifyItemRangeRemoved(event.index + added, removed - added);
761
- }
762
- }
763
- else {
764
- if (event.removed && event.removed.length > 0) {
765
- this._listViewAdapter.notifyItemRangeRemoved(event.index, event.removed.length);
766
- }
767
- if (event.addedCount > 0) {
768
- this._listViewAdapter.notifyItemRangeInserted(event.index, event.addedCount);
769
- }
770
- }
771
- }
772
- return;
773
- }
774
- }
775
- this._listViewAdapter.notifyDataSetChanged();
776
- }
777
- eachChild(callback) {
778
- // used for css updates (like theme change)
779
- this.enumerateViewHolders((v) => {
780
- const view = v.view;
781
- if (view) {
782
- if (view.parent instanceof CollectionView) {
783
- callback(view);
784
- }
785
- else {
786
- // in some cases (like item is unloaded from another place (like angular) view.parent becomes undefined)
787
- if (view.parent) {
788
- callback(view.parent);
789
- }
790
- }
791
- }
792
- });
793
- }
794
- refreshVisibleItems() {
795
- const view = this.nativeViewProtected;
796
- if (!view) {
797
- return;
798
- }
799
- const ids = Array.from(this.bindedViewHolders)
800
- .sort((a, b) => a - b);
801
- this._listViewAdapter.notifyItemRangeChanged(ids[0], ids[ids.length - 1] - ids[0] + 1);
802
- }
803
- isItemAtIndexVisible(index) {
804
- const view = this.nativeViewProtected;
805
- if (!view) {
806
- return false;
807
- }
808
- const layoutManager = this.layoutManager;
809
- if (layoutManager['findFirstVisibleItemPosition']) {
810
- const first = layoutManager.findFirstVisibleItemPosition();
811
- const last = layoutManager.findLastVisibleItemPosition();
812
- return index >= first && index <= last;
813
- }
814
- return false;
815
- }
816
- refresh(forceRefresh = false, updateSpanCountRequestsLayout = false) {
817
- if (this.mInPropertiesSet) {
818
- this.mShouldRefresh = true;
819
- return;
820
- }
821
- this.mShouldRefresh = false;
822
- const view = this.nativeViewProtected;
823
- if (!view) {
824
- return;
825
- }
826
- // seems like we refresh sooner
827
- // not sure why it was needed before and not now.
828
- if (!forceRefresh && (!this.isLoaded || !this.nativeView)) {
829
- this._isDataDirty = true;
830
- return;
831
- }
832
- this._isDataDirty = false;
833
- this._lastLayoutKey = this._innerWidth + '_' + this._innerHeight;
834
- let adapter = this._listViewAdapter;
835
- if (!adapter) {
836
- adapter = this._listViewAdapter = this.createComposedAdapter(view);
837
- adapter.setHasStableIds(!!this._itemIdGenerator);
838
- view.setAdapter(adapter);
839
- }
840
- else if (!view.getAdapter()) {
841
- view.setAdapter(adapter);
842
- }
843
- this.updateSpanCount(updateSpanCountRequestsLayout);
844
- adapter.notifyDataSetChanged();
845
- this.notify({ eventName: CollectionViewBase.dataPopulatedEvent });
846
- }
847
- //@ts-ignore
848
- get scrollOffset() {
849
- const view = this.nativeViewProtected;
850
- if (!view) {
851
- return 0;
852
- }
853
- return (this.isHorizontal() ? view.computeHorizontalScrollOffset() : view.computeVerticalScrollOffset()) / Utils.layout.getDisplayDensity();
854
- }
855
- get verticalOffsetX() {
856
- const view = this.nativeViewProtected;
857
- if (!view) {
858
- return 0;
859
- }
860
- return view.computeHorizontalScrollOffset() / Utils.layout.getDisplayDensity();
861
- }
862
- get verticalOffsetY() {
863
- const view = this.nativeViewProtected;
864
- if (!view) {
865
- return 0;
866
- }
867
- return view.computeVerticalScrollOffset() / Utils.layout.getDisplayDensity();
868
- }
869
- scrollToIndex(index, animated = true, snap = SnapPosition.START) {
870
- const view = this.nativeViewProtected;
871
- if (!view) {
872
- return;
873
- }
874
- if (animated) {
875
- view.smoothScrollToPosition(index, snap);
876
- }
877
- else {
878
- view.scrollToPosition(index);
879
- }
880
- }
881
- scrollToOffset(offSetValue) {
882
- const view = this.nativeViewProtected;
883
- if (view && this.isScrollEnabled) {
884
- if (this.orientation === 'horizontal') {
885
- view.scrollBy(offSetValue, 0);
886
- }
887
- else {
888
- view.scrollBy(0, offSetValue);
889
- }
890
- }
891
- }
892
- _setPadding(newPadding) {
893
- const nativeView = this.nativeViewProtected;
894
- const padding = {
895
- top: nativeView.getPaddingTop(),
896
- right: nativeView.getPaddingRight(),
897
- bottom: nativeView.getPaddingBottom(),
898
- left: nativeView.getPaddingLeft()
899
- };
900
- // tslint:disable-next-line:prefer-object-spread
901
- const newValue = Object.assign(padding, newPadding);
902
- nativeView.setClipToPadding(false);
903
- nativeView.setPadding(newValue.left, newValue.top, newValue.right, newValue.bottom);
904
- this.updateInnerSize();
905
- }
906
- createComposedAdapter(recyclerView) {
907
- const adapter = new com.nativescript.collectionview.Adapter();
908
- adapter.adapterInterface = new com.nativescript.collectionview.AdapterInterface({
909
- getItemId: this.getItemId.bind(this),
910
- getItemViewType: this.getItemViewType.bind(this),
911
- getItemCount: this.getItemCount.bind(this),
912
- onCreateViewHolder: this.onCreateViewHolder.bind(this),
913
- onBindViewHolder: this.onBindViewHolder.bind(this),
914
- onViewRecycled: this.onViewRecycled.bind(this)
915
- });
916
- // const composedAdapter = new com.h6ah4i.android.widget.advrecyclerview.composedadapter.ComposedAdapter();
917
- // composedAdapter.addAdapter(new CollectionViewAdapter(new WeakRef(this)));
918
- return adapter;
919
- }
920
- getItemCount() {
921
- return this.items ? this.items.length : 0;
922
- }
923
- getItem(i) {
924
- if (this.items && i < this.items.length) {
925
- return this.getItemAtIndex(i);
926
- }
927
- return null;
928
- }
929
- getItemId(i) {
930
- let id = -1;
931
- if (this._itemIdGenerator && this.items) {
932
- const item = this.getItemAtIndex(i);
933
- id = this._itemIdGenerator(item, i, this.items);
934
- }
935
- return long(id);
936
- }
937
- onItemIdGeneratorChanged(oldValue, newValue) {
938
- super.onItemIdGeneratorChanged(oldValue, newValue);
939
- if (this._listViewAdapter) {
940
- this._listViewAdapter.setHasStableIds(!!newValue);
941
- }
942
- }
943
- clearTemplateTypes() {
944
- this._currentNativeItemType = 0;
945
- this.templateTypeNumberString.clear();
946
- this.templateStringTypeNumber.clear();
947
- }
948
- getItemViewType(position) {
949
- let selectorType = 'default';
950
- if (this._itemTemplateSelector) {
951
- const selector = this._itemTemplateSelector;
952
- const dataItem = this.getItemAtIndex(position);
953
- if (dataItem) {
954
- selectorType = selector.call(this, dataItem, position, this.items);
955
- }
956
- }
957
- return this.templateKeyToNativeItem(selectorType);
958
- // if (!this.templateTypeNumberString.has(selectorType)) {
959
- // resultType = this._currentNativeItemType;
960
- // this.templateTypeNumberString.set(selectorType, resultType);
961
- // this.templateStringTypeNumber.set(resultType, selectorType);
962
- // this._currentNativeItemType++;
963
- // } else {
964
- // resultType = this.templateTypeNumberString.get(selectorType);
965
- // }
966
- // return resultType;
967
- }
968
- templateKeyToNativeItem(key) {
969
- if (!this.templateTypeNumberString) {
970
- this.templateTypeNumberString = new Map();
971
- this._currentNativeItemType = 0;
972
- this._itemTemplatesInternal.forEach((v, i) => {
973
- this.templateTypeNumberString.set(v.key, this._currentNativeItemType);
974
- this.templateStringTypeNumber.set(this._currentNativeItemType, v.key);
975
- this.setNativePoolSize(v.key, this._currentNativeItemType);
976
- this._currentNativeItemType++;
977
- });
978
- this._currentNativeItemType = Math.max(this._itemTemplatesInternal.size, 100);
979
- // templates will be numbered 0,1,2,3... for named templates
980
- // default/unnamed templates will be numbered 100, 101, 102, 103...
981
- }
982
- if (!this.templateTypeNumberString.has(key)) {
983
- this.templateTypeNumberString.set(key, this._currentNativeItemType);
984
- this.templateStringTypeNumber.set(this._currentNativeItemType, key);
985
- this.setNativePoolSize(key, this._currentNativeItemType);
986
- this._currentNativeItemType++;
987
- }
988
- return this.templateTypeNumberString.get(key);
989
- }
990
- // public nativeItemToTemplateKey(item: number): string {
991
- // let result: string;
992
- // this.templateTypeNumberString?.forEach((value, key, map) => {
993
- // if (value === item) {
994
- // result = key;
995
- // }
996
- // }, this);
997
- // return result;
998
- // }
999
- disposeViewHolderViews() {
1000
- this.enumerateViewHolders((v) => {
1001
- const view = v.view;
1002
- if (view) {
1003
- if (view.isLoaded) {
1004
- view.callUnloaded();
1005
- }
1006
- view._isAddedToNativeVisualTree = false;
1007
- view._tearDownUI();
1008
- }
1009
- v.view = null;
1010
- v.clickListener = null;
1011
- });
1012
- this._viewHolders = new Set();
1013
- }
1014
- getKeyByValue(viewType) {
1015
- return this.templateStringTypeNumber.get(viewType);
1016
- }
1017
- onCreateViewHolder(parent, viewType) {
1018
- const start = Date.now();
1019
- let view = this.getViewForViewType(ListViewViewTypes.ItemView, this.getKeyByValue(viewType));
1020
- const isNonSync = view === undefined;
1021
- // dont create unecessary StackLayout if template.createView returns. Will happend when not using Vue or angular
1022
- if (isNonSync || view instanceof ProxyViewContainer) {
1023
- const parentView = new ContentView();
1024
- parentView.id = 'collectionViewHolder';
1025
- view = parentView;
1026
- }
1027
- view._setupAsRootView(this._context);
1028
- view._isAddedToNativeVisualTree = true;
1029
- //@ts-ignore
1030
- view.parent = this;
1031
- view.callLoaded();
1032
- if (!CollectionViewCellHolder) {
1033
- CollectionViewCellHolder = com.nativescript.collectionview.CollectionViewCellHolder;
1034
- }
1035
- const holder = new CollectionViewCellHolder(view.nativeView);
1036
- const collectionView = this;
1037
- const clickListener = new android.view.View.OnClickListener({
1038
- onClick: () => {
1039
- const position = holder.getAdapterPosition();
1040
- collectionView.notify({
1041
- eventName: CollectionViewBase.itemTapEvent,
1042
- object: collectionView,
1043
- index: position,
1044
- item: collectionView.getItem(position),
1045
- view: holder.view
1046
- });
1047
- }
1048
- });
1049
- view.nativeView.setOnClickListener(clickListener);
1050
- holder.clickListener = clickListener;
1051
- holder.view = view;
1052
- const layoutParams = this._getViewLayoutParams();
1053
- view.nativeView.setLayoutParams(layoutParams);
1054
- if (isNonSync) {
1055
- holder['defaultItemView'] = true;
1056
- }
1057
- this._viewHolders.add(holder);
1058
- if (Trace.isEnabled()) {
1059
- CLog(CLogTypes.log, 'onCreateViewHolder', this, this.nativeView, viewType, this.getKeyByValue(viewType), holder, Date.now() - start, 'ms');
1060
- }
1061
- return holder;
1062
- }
1063
- notifyForItemAtIndex(eventName, view, index, bindingContext, native) {
1064
- const args = { eventName, object: this, index, view, ios: native, bindingContext };
1065
- this.notify(args);
1066
- return args;
1067
- }
1068
- onBindViewHolder(holder, position) {
1069
- const start = Date.now();
1070
- if (Trace.isEnabled()) {
1071
- CLog(CLogTypes.log, 'onBindViewHolder', this, this.nativeView, position, holder, holder.view);
1072
- }
1073
- let view = holder.view;
1074
- const isNonSync = holder['defaultItemView'] === true;
1075
- view = isNonSync ? view.content : view;
1076
- const bindingContext = this._prepareItem(view, position);
1077
- if (holder['position'] !== undefined) {
1078
- this.bindedViewHolders.delete(holder['position']);
1079
- }
1080
- holder['position'] = position;
1081
- this.bindedViewHolders.add(holder['position']);
1082
- const args = this.notifyForItemAtIndex(CollectionViewBase.itemLoadingEvent, view, position, bindingContext, holder);
1083
- if (isNonSync && args.view !== view) {
1084
- view = args.view;
1085
- // the view has been changed on the event handler
1086
- holder.view.content = args.view;
1087
- }
1088
- view.bindingContext = bindingContext;
1089
- view.notify({ eventName: CollectionViewBase.bindedEvent });
1090
- let width = this._effectiveColWidth;
1091
- let height = this._effectiveRowHeight;
1092
- if (this._getSpanSize) {
1093
- const spanSize = this._getSpanSize(bindingContext, position);
1094
- const horizontal = this.isHorizontal();
1095
- if (horizontal) {
1096
- height *= spanSize;
1097
- }
1098
- else {
1099
- width *= spanSize;
1100
- }
1101
- }
1102
- if (width || !view.width) {
1103
- view.width = Utils.layout.toDeviceIndependentPixels(width);
1104
- }
1105
- if (height || !view.height) {
1106
- view.height = Utils.layout.toDeviceIndependentPixels(height);
1107
- }
1108
- // if (this.hasListeners(CollectionViewBase.displayItemEvent) ) {
1109
- // this.notify<CollectionViewItemDisplayEventData>({
1110
- // eventName: CollectionViewBase.displayItemEvent,
1111
- // index:position,
1112
- // object: this,
1113
- // });
1114
- // }
1115
- if (Trace.isEnabled()) {
1116
- CLog(CLogTypes.log, 'onBindViewHolder done ', position, Date.now() - start, 'ms');
1117
- }
1118
- }
1119
- onViewRecycled(holder) {
1120
- delete this.bindedViewHolders[holder['position']];
1121
- holder['position'] = undefined;
1122
- }
1123
- }
1124
- CollectionView.layoutCompletedEvent = 'layoutCompleted';
1125
- CollectionView.DEFAULT_TEMPLATE_VIEW_TYPE = 0;
1126
- CollectionView.CUSTOM_TEMPLATE_ITEM_TYPE = 1;
1127
- __decorate([
1128
- profile
1129
- ], CollectionView.prototype, "createNativeView", null);
1130
- __decorate([
1131
- profile
1132
- ], CollectionView.prototype, "initNativeView", null);
1133
- __decorate([
1134
- profile
1135
- ], CollectionView.prototype, "disposeNativeView", null);
1136
- __decorate([
1137
- profile
1138
- ], CollectionView.prototype, "onLoaded", null);
1139
- __decorate([
1140
- profile
1141
- ], CollectionView.prototype, "attachScrollListener", null);
1142
- __decorate([
1143
- profile
1144
- ], CollectionView.prototype, "setNativePoolSize", null);
1145
- __decorate([
1146
- profile
1147
- ], CollectionView.prototype, "setPoolSizes", null);
1148
- __decorate([
1149
- profile
1150
- ], CollectionView.prototype, _a, null);
1151
- __decorate([
1152
- profile
1153
- ], CollectionView.prototype, _b, null);
1154
- __decorate([
1155
- profile
1156
- ], CollectionView.prototype, "onItemViewLoaderChanged", null);
1157
- __decorate([
1158
- profile
1159
- ], CollectionView.prototype, "onItemTemplateSelectorChanged", null);
1160
- __decorate([
1161
- profile
1162
- ], CollectionView.prototype, "onItemTemplateChanged", null);
1163
- __decorate([
1164
- profile
1165
- ], CollectionView.prototype, "onItemTemplatesChanged", null);
1166
- __decorate([
1167
- profile
1168
- ], CollectionView.prototype, "updateSpanCount", null);
1169
- __decorate([
1170
- profile
1171
- ], CollectionView.prototype, "updateInnerSize", null);
1172
- __decorate([
1173
- profile
1174
- ], CollectionView.prototype, "_onColWidthPropertyChanged", null);
1175
- __decorate([
1176
- profile
1177
- ], CollectionView.prototype, "_onRowHeightPropertyChanged", null);
1178
- __decorate([
1179
- profile
1180
- ], CollectionView.prototype, "onLayout", null);
1181
- __decorate([
1182
- profile
1183
- ], CollectionView.prototype, "onMeasure", null);
1184
- __decorate([
1185
- profile
1186
- ], CollectionView.prototype, "refresh", null);
1187
- __decorate([
1188
- profile
1189
- ], CollectionView.prototype, "_setPadding", null);
1190
- __decorate([
1191
- profile
1192
- ], CollectionView.prototype, "createComposedAdapter", null);
1193
- __decorate([
1194
- profile
1195
- ], CollectionView.prototype, "clearTemplateTypes", null);
1196
- __decorate([
1197
- profile
1198
- ], CollectionView.prototype, "getItemViewType", null);
1199
- __decorate([
1200
- profile
1201
- ], CollectionView.prototype, "templateKeyToNativeItem", null);
1202
- __decorate([
1203
- profile
1204
- ], CollectionView.prototype, "disposeViewHolderViews", null);
1205
- __decorate([
1206
- profile
1207
- ], CollectionView.prototype, "onCreateViewHolder", null);
1208
- __decorate([
1209
- profile
1210
- ], CollectionView.prototype, "notifyForItemAtIndex", null);
1211
- __decorate([
1212
- profile
1213
- ], CollectionView.prototype, "onBindViewHolder", null);
1214
- let CollectionViewCellHolder;
1215
- let CollectionViewRecyclerView;
1216
- itemViewCacheSizeProperty.register(CollectionViewBase);
1217
- extraLayoutSpaceProperty.register(CollectionViewBase);
1218
- nestedScrollingEnabledProperty.register(CollectionViewBase);
1219
- //# sourceMappingURL=index.android.js.map