Improvements in ASCollectionGalleryLayoutDelegate (#496)

* Improvements in ASCollectionGalleryLayoutDelegate
- It now can handle section inset, as well as interitem and line spacings
- Other small changes

* Fix build failure and update file licenses

* Update CHANGELOG

* Minor change

* Another assertion on scrollable directions of gallery layout delegate
This commit is contained in:
Huy Nguyen
2017-08-08 19:11:40 +01:00
committed by GitHub
parent d2adb8f126
commit fdc1f0468c
13 changed files with 364 additions and 132 deletions

View File

@@ -23,7 +23,7 @@
#define ASYNC_COLLECTION_LAYOUT 0
@interface ViewController () <ASCollectionDataSource, ASCollectionDelegateFlowLayout, ASCollectionGalleryLayoutSizeProviding>
@interface ViewController () <ASCollectionDataSource, ASCollectionDelegateFlowLayout, ASCollectionGalleryLayoutPropertiesProviding>
@property (nonatomic, strong) ASCollectionNode *collectionNode;
@property (nonatomic, strong) NSArray *data;
@@ -48,7 +48,7 @@
#if ASYNC_COLLECTION_LAYOUT
ASCollectionGalleryLayoutDelegate *layoutDelegate = [[ASCollectionGalleryLayoutDelegate alloc] initWithScrollableDirections:ASScrollDirectionVerticalDirections];
layoutDelegate.sizeProvider = self;
layoutDelegate.propertiesProvider = self;
self.collectionNode = [[ASCollectionNode alloc] initWithLayoutDelegate:layoutDelegate layoutFacilitator:nil];
#else
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
@@ -108,7 +108,7 @@
[self.collectionNode reloadData];
}
#pragma mark - ASCollectionGalleryLayoutSizeProviding
#pragma mark - ASCollectionGalleryLayoutPropertiesProviding
- (CGSize)sizeForElements:(ASElementMap *)elements
{