Skip to content

Commit bb52a55

Browse files
committed
feat(collectionview): android nestedScrollingEnabled property
1 parent 4c27279 commit bb52a55

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/collectionview/collectionview.android.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
Trace,
1111
View,
1212
ViewBase,
13+
booleanConverter,
1314
paddingBottomProperty,
1415
paddingLeftProperty,
1516
paddingRightProperty,
@@ -187,6 +188,12 @@ const extraLayoutSpaceProperty = new Property<CollectionViewBase, number>({
187188
const itemViewCacheSizeProperty = new Property<CollectionViewBase, number>({
188189
name: 'itemViewCacheSize'
189190
});
191+
192+
const nestedScrollingEnabledProperty = new Property<CollectionViewBase, boolean>({
193+
name: 'nestedScrollingEnabled',
194+
defaultValue: true,
195+
valueConverter: booleanConverter
196+
});
190197
export class CollectionView extends CollectionViewBase {
191198
public static DEFAULT_TEMPLATE_VIEW_TYPE = 0;
192199
public static CUSTOM_TEMPLATE_ITEM_TYPE = 1;
@@ -222,6 +229,10 @@ export class CollectionView extends CollectionViewBase {
222229

223230
public animateItemUpdate = false;
224231

232+
public nestedScrollingEnabled: boolean;
233+
public itemViewCacheSize: number;
234+
public extraLayoutSpace: number;
235+
225236
@profile
226237
public createNativeView() {
227238
// storing the class in a property for reuse in the future cause a materializing which is pretty slow!
@@ -542,6 +553,9 @@ export class CollectionView extends CollectionViewBase {
542553
// layoutManager['setStackFromEnd'](value);
543554
}
544555
}
556+
[nestedScrollingEnabledProperty.setNative](value: boolean) {
557+
this.nativeViewProtected.setNestedScrollingEnabled(value);
558+
}
545559
[extraLayoutSpaceProperty.setNative](value: number) {
546560
const layoutManager = this.layoutManager;
547561
if (layoutManager && layoutManager['setExtraLayoutSpace']) {
@@ -1112,3 +1126,4 @@ export interface CollectionViewRecyclerView extends com.nativescript.collectionv
11121126
let CollectionViewRecyclerView: CollectionViewRecyclerView;
11131127
itemViewCacheSizeProperty.register(CollectionViewBase);
11141128
extraLayoutSpaceProperty.register(CollectionViewBase);
1129+
nestedScrollingEnabledProperty.register(CollectionViewBase);

0 commit comments

Comments
 (0)