80 Commits

Author SHA1 Message Date
Levi McCallum
db0a0326d7 Rename layoutDelegate to layoutInspector in ASCollectionView 2015-10-21 23:17:38 -07:00
Levi McCallum
8f289d9977 Back internal kind collection with a set 2015-10-21 23:17:37 -07:00
Levi McCallum
12194199cd Clean up layout delegate protocol API 2015-10-15 11:40:53 -07:00
Levi McCallum
772e9b95a4 Document layout delegate on ASCollectionView 2015-10-15 11:40:53 -07:00
Levi McCallum
0446902c17 Remove supplementary view assertion 2015-10-15 11:40:53 -07:00
Levi McCallum
e2bbde2a4e Clean up usage of internal flow layout inspector 2015-10-15 11:40:53 -07:00
Levi McCallum
ee0cc2001a Add support for loaded node layout for supplementary views 2015-10-15 11:40:52 -07:00
Levi McCallum
ba72c73779 Clarify default value behavior of the layoutDelegate for flow layouts 2015-10-15 11:40:52 -07:00
Levi McCallum
fddb0061b0 Use ASCellNodes for supplementary nodes 2015-10-15 11:40:52 -07:00
Levi McCallum
0870d50e36 Clarify layout delegate assertion messages 2015-10-15 11:40:52 -07:00
Levi McCallum
71966f3549 Relayout all nodes in backing store on relayoutAllNodes 2015-10-15 11:40:51 -07:00
Levi McCallum
5839e5bf3e Assert supplementary node validity before data controller use 2015-10-15 11:40:51 -07:00
Levi McCallum
2958c848aa Asset presence of async delegate before accessing layout delegate 2015-10-15 11:40:50 -07:00
Levi McCallum
8efca60bac Handle initial sizing delegate implementation in flow layout inspector 2015-10-15 11:40:50 -07:00
Levi McCallum
ba4298e6bc Optimize string concatenation 2015-10-15 11:40:50 -07:00
Levi McCallum
b436a01000 Assert supplementary node kind registration 2015-10-15 11:40:50 -07:00
Levi McCallum
835f9e99ca Batch render supplementary views on reload data 2015-10-15 11:40:49 -07:00
Levi McCallum
73ddebed81 Implement UICollectionViewFlowLayout heuristics in a default inspector 2015-10-15 11:40:49 -07:00
Levi McCallum
a659ce7bf8 Cleanup setup of default flow layout inspector 2015-10-15 11:40:49 -07:00
Levi McCallum
4c6585d3b3 Fix build errors from bad merge 2015-10-15 11:40:49 -07:00
Levi McCallum
5dee3f62cc Extract number of supplementary sections into the inspector 2015-10-15 11:40:49 -07:00
Levi McCallum
da7a2a5d48 Further implement data controller support and layout introspection 2015-10-15 11:40:49 -07:00
Levi McCallum
e9eadac4ae Stub out ASCollectionDataController subclass 2015-10-15 11:40:48 -07:00
Levi McCallum
0d2332bd82 Allow ASCollectionView to register for supplementary container 2015-10-15 11:38:48 -07:00
Levi McCallum
2956c0cd8a Extract flow layout methods into a separate delegate 2015-10-15 11:38:47 -07:00
Vitaly Baev
1a78cd2e66 ASCellNode selected/highlighted properties in ASCollectionView 2015-10-15 20:27:42 +03:00
Scott Goodson
a8435b494c Revert "Properly support operating with nil asyncDelegate for Table & Collection."
This reverts commit 77745c55b084c51d57a405073a6e9b00c379f918.

Bug was found / reported in https://github.com/facebook/AsyncDisplayKit/issues/721

Attempting resolution here, but need to fix for current clients now:
https://github.com/facebook/AsyncDisplayKit/pull/724
2015-10-07 14:48:37 -07:00
Scott Goodson
77745c55b0 Properly support operating with nil asyncDelegate for Table & Collection. 2015-10-04 17:11:41 -07:00
Scott Goodson
a58844379c Implementation of Synchronous Concurrency features for AsyncDisplayKit 2.0
This provides internal features on _ASAsyncTransaction and ASDisplayNode to facilitate
implementing public API that allows clients to choose if they would prefer to block
on the completion of unfinished rendering, rather than allow a placeholder state to
become visible.

The internal features are:
-[_ASAsyncTransaction waitUntilComplete]
-[ASDisplayNode recursivelyEnsureDisplay]

Also provided are two such implementations:
-[ASCellNode setNeverShowPlaceholders:], which integrates with both Tables and Collections
-[ASViewController setNeverShowPlaceholders:], which should work with Nav and Tab controllers.

Lastly, on ASDisplayNode, a new property .shouldBypassEnsureDisplay allows individual node types
to exempt themselves from blocking the main thread on their display.

By implementing the feature at the ASCellNode level rather than ASTableView & ASCollectionView,
developers can retain fine-grained control on display characteristics.  For example, certain
cell types may be appropriate to display to the user with placeholders, whereas others may not.

Follow-up work will include unit tests, revisiting names, and the header locations of definitions.
2015-09-27 19:14:36 -07:00
Scott Goodson
ee4b771d5d Fix simple issue with ASTableViewStressTest, make Table / Collection handle changes to dataSource / delegate. 2015-09-24 19:59:12 -07:00
Adlai Holler
86c1fa3981 Rename flag, default it to true, shorten some comment lines 2015-09-19 14:21:33 -07:00
Adlai Holler
7cd79e6e6f Tweak comment 2015-09-19 13:43:18 -07:00
Adlai Holler
f0f26d3dab Tweak the new pendingReload flag 2015-09-19 13:40:41 -07:00
Adlai Holler
77490e11c0 ASCollectionView: Suspend updates while reload data is pending 2015-09-19 13:35:57 -07:00
Huy Nguyen
a8cecbd0ad Avoid doing relayout during initial configuration of table and collection views. 2015-09-08 22:43:28 +03:00
Scott Goodson
08e31e1c37 Created ASCollectionNode with new example project.
Eases support for nesting horizontally scrolling elements within a vertical scroller.

Further changes will improve the API, and optimize handling of the nested working ranges.
2015-09-07 12:54:42 -07:00
Garrett Moon
6624b84c4c Static layout doesn't properly set a height for collection view cells
because their size.width / size.height isn't nan, but FLT_MAX.
2015-08-20 10:40:00 -07:00
Huy Nguyen
7249661990 Improve relayout when constrained size of all nodes is changed:
- In -layoutSubviews of table and collection views, detect changes that cause a different constrained size for nodes, and trigger relayout immediately.
- Orientation change can be handled by this solution. So, no need to observe to its events.
- Update Kittens example to support iPad (easier to catch bugs on these devices) and add a title to navigation bar (looks a bit nicer).
2015-08-13 06:28:47 +03:00
Huy Nguyen
a3c2dbf8cd Table and collection views' async data source can provide different constrained size per node. And because the size is of type ASSizeRange, it has a min size that is very helpful in many cases.. 2015-08-12 22:45:08 +03:00
Garrett Moon
592e0301dd cache result of responds to selector 2015-08-12 11:46:46 -07:00
Garrett Moon
4f4a26d2a3 ASDK now supports non-flow layouts. We shouldn't be assuming a flow layout. 2015-08-12 11:33:40 -07:00
Huy Nguyen
e657bedd40 Automatically relayout cells after orientation changed. 2015-08-09 00:36:58 +03:00
Huy Nguyen
60ed2bca47 Fix _implementsInsetSection of ASCollectionView being check before the asyncDelegate is set. 2015-08-05 17:33:56 +03:00
Levi McCallum
5eb75d6bc7 Add support for sectionInset in ASCollectionView in property and delegate form 2015-08-03 14:36:29 -07:00
Scott Goodson
46bbe479ae Implement warning assertion for supplementary views in ASCollectionView.
Make sure ASTableViewStressTest passes.  It was sometimes testing a scenario UITableView itself doesn't support.
2015-07-25 21:25:40 -07:00
Ethan Nagel
bf0766169b PR Feedback: Require main thread for all edit commands, various cleanup. 2015-07-20 22:08:19 -07:00
Ethan Nagel
f497639124 Add support automatically adjusting the content offset to UITableView as well as support for performing endUpdates with no animations. Additionally, there are critical bug fixes for ASDataController (begin/end updates delegates not called in correct order) and ASRangeController (failure to fully refresh internal state when inserts or delete are made.) 2015-07-20 14:05:56 -07:00
Ethan Nagel
c14ecd7e99 short-circuit editing calls after the asyncDataSource has been set to nil (ASCollectionView) 2015-07-16 20:26:45 -07:00
Scott Goodson
06cfe68cbd Clean up ASDataController for readability & API naming consistency. 2015-06-27 11:06:54 -07:00
Rene Cacheaux
0b8f10e488 Removes UICollectionViewFlowLayout requirement. This allows custom collection view layouts. 2015-06-23 13:39:12 -05:00