WIP: Updating IGListGridCollectionViewLayout to be more flexible#423
WIP: Updating IGListGridCollectionViewLayout to be more flexible#423zhubofei wants to merge 9 commits into
Conversation
| An option for how to align items in grid layout. | ||
| */ | ||
| typedef NS_ENUM(NSInteger, IGListGridCollectionViewLayoutAlignment) { | ||
| IGListGridCollectionViewLayoutAlignDefault, |
There was a problem hiding this comment.
- what does
Defaultmean? i would expect to seeLeft,Right,Center... - nit: can we spell-out
Alignmentfor each enum case? (follows conventions)
|
@zhubofei updated the pull request - view changes |
1 similar comment
|
@zhubofei updated the pull request - view changes |
|
@zhubofei updated the pull request - view changes |
|
@zhubofei updated the pull request - view changes |
|
@zhubofei updated the pull request - view changes |
|
@zhubofei updated the pull request - view changes |
|
@zhubofei heads up that we are talking internally about adding a layout we built for IG to IGLK. It does all of this and is wicked fast. If we do, we'll probably decide to stick w/ that one layout. Just want you to know so you don't spend tons of time on this just for us to replace it. Sorry if this causes some thrash! |
|
@rnystrom This is a great news! I'm actually really worried about the performance of my implementation and cannot come up with a better layout algorithm. Really curious about the wicked fast algorithm from you guys, can't wait to see it! |
|
@rnystrom The new layout is superb! I actually thought about rewriting the whole thing with objective-c++ before, but lack the motivation to do so 😂. I'll close this one then. |
Summary: Working on porting our collection view layout to IGListKit. I'm doing this because its a solid layout, and we just finished preparing it to work with inline sections. It is designed to work in tandem with IGListKit, so we're adding it. This is still a WIP as I add more tests, but I'd love as much feedback as possible. Aside from the glob of header documentation, this has the following features: - Infinite sections that each have infinite items. Sections and items can fall inline. When they break the width of their container they will fall on the next row. - Sections can have their own insets, line spacing, and interitem spacing. - Sticky header support! When you use headers, it will always newline the section. - Maximum width with a border decoration view - Use this to pinch in your content on larger devices Followup to #423 - [ ] ~~Move decoration view support to delegate~~ removed - [x] Unit test changing [top y sticky inset](https://coveralls.io/builds/9977284/source?filen Closes #450 Reviewed By: jessesquires Differential Revision: D4521797 Pulled By: rnystrom fbshipit-source-id: 20b36ae573d38ca3125a6f3d5faec181c290ab94
Summary: Working on porting our collection view layout to IGListKit. I'm doing this because its a solid layout, and we just finished preparing it to work with inline sections. It is designed to work in tandem with IGListKit, so we're adding it. This is still a WIP as I add more tests, but I'd love as much feedback as possible. Aside from the glob of header documentation, this has the following features: - Infinite sections that each have infinite items. Sections and items can fall inline. When they break the width of their container they will fall on the next row. - Sections can have their own insets, line spacing, and interitem spacing. - Sticky header support! When you use headers, it will always newline the section. - Maximum width with a border decoration view - Use this to pinch in your content on larger devices Followup to #423 - [ ] ~~Move decoration view support to delegate~~ removed - [x] Unit test changing [top y sticky inset](https://coveralls.io/builds/9977284/source?filen Closes #484 Differential Revision: D4547760 Pulled By: rnystrom fbshipit-source-id: 879e2da16eb78bb6a90967e77d9ad0bbf7c69594
|
@zhubofei Since pr#484 and pr#450 are already closed, do you think we can expect this pull request reopen? Anyway, I have some comments:
Thanks! |
|
@ShaneQi We need @rnystrom 's opinion on the alignment option. I'm happy to work on it if he approves this option.
This one, though, is too complicated for a general layout. I suggest you subclass the layout and customize it as needed. |
|
Thanks for the reply and all the contribution you've done! |
|
@ShaneQi sadly we replaced this layout with #484. Agree w/ @zhubofei that alignment might just be beyond the scope of IGListKit and require a more comprehensive If someone has an elegant way to extend our layout, I'm very into a PR to try some stuff out. |
Changes in this pull request
Updating the grid layout to fit more general cases.
Closes #263
TODO
IGListGridCollectionViewLayoutAlignmentoption. Allow user to set alignment for the layout.