99 Commits
Author SHA1 Message Date
appleguy bd4b8601ba Merge pull request #837 from levi/levi/cell-selection
Fix selection inconsistency in ASTableView/ASCollectionView cell implementation
2015-11-28 16:56:25 -08:00
appleguy 15f718ddc9 Merge pull request #868 from levi/levi/remove-deprecated
Clean up syntax and organization of ASRangeController
2015-11-23 21:24:58 -08:00
Levi McCallum e05c4b7419 Separate range controller delegate methods into separate data source 2015-11-19 16:01:38 -08:00
Levi McCallum 09a2e086b0 Clean up syntax and method ordering in ASRangeController 2015-11-19 14:03:53 -08:00
Scott Goodson 2a0b9c8e14 Substantially improve behavior of nested Table & Collection Nodes
This ensures memory cleanup happens correctly and introduces a new test project
to support developing new features while stressing tough use cases for correctness.
2015-11-14 15:25:35 -08:00
Levi McCallum 01876ae683 Fix bad rebase 2015-11-11 10:50:20 -08:00
Levi McCallum 2d93192b9f Fix selection behavior of ASTableView cells 2015-11-11 01:06:28 -08:00
appleguy b295eda4b1 Merge pull request #823 from vitalybaev/SocialAppExample
New example app -- a "social" feed similar to Facebook or Twitter
2015-11-08 18:53:22 -08:00
Vitaly Baev b1784bcf9b Fix ASTableViewCell's node selected/highlighted property 2015-11-06 13:46:30 +03:00
Huy Nguyen 12dbfd1992 Only set a default layout delegate to ASCellNode if it is not provided by the async data source 2015-11-04 16:53:36 +02:00
Huy Nguyen 5701cbba40 After relayout of a cell node, table and collection views trigger an empty update transaction, instead of a reload 2015-11-04 16:53:33 +02:00
Scott Goodson e517f88e65 Rename ASCellNode delegate to layoutDelegate to avoid common naming overlap 2015-11-01 12:51:46 -08:00
appleguy 0598935957 Merge pull request #793 from nguyenhuy/ImproveCellNodeRelayout
ASCellNode delegate to automatically resize in table & collection when -setNeedsLayout called.
2015-11-01 11:11:32 -08:00
Huy Nguyen fb18e7635b Notify ASCellNodeDelegate even if a relayout doesn't result in a resize
If the delegate is an ASTableView, relayoutAnimation will still be considered for animation.
2015-10-29 21:27:29 +02:00
Huy Nguyen 00400e166f Introduce ASCellNodeDelegate
- Cell node automatically notifies the delegate after a relayout (via -setNeedsLayout) that results in a new size. Confirming to ASCellNodeDelegate; ASTableView and ASCollectionView reload the calling cell upon notifications. These views automatically set themselves as delegate of every node.
- The result is that ASCellNode subclasses don't need to manually notify the containing view. Thus, `-relayoutItemAtIndexPath` and `-relayoutRowAtIndexPath` are removed.
- Kittens example is updated to reflect the change.
2015-10-29 16:59:46 +02:00
Huy Nguyen cd31f884dd Move ASDisplayNodePerformBlockOnMainThread to ASInternalHelpers 2015-10-29 16:09:36 +02:00
Adlai Holler 50485663b9 Never use setAnimationsEnabled: so we don't risk corrupting enabledness 2015-10-28 16:09:56 -07:00
appleguy 2c8626e1f6 Merge pull request #753 from nguyenhuy/DataControllerSortedTransaction
Sort edit commands during batch updating of table and collection views
2015-10-26 13:40:06 -07:00
Huy Nguyen 6644621c04 Revert "Fix unnecessary relayout if table view width is zero initially"
This reverts commit 7533118945.
2015-10-26 14:28:28 +02:00
Huy Nguyen 72fca5395f Inject an ASDataController class to ASTableView, for testing purposes
- Injection can be done via a new internal initializer. The class will be used by ASTableView to create (and configure) a new data controller.
- ASTableViewTests now injects its own type of ASDataController. This facilitates new ways for testing ASTableView-specific behaviours. The first application is counting the number of times relayoutAllNodes is called on the data controller.
2015-10-26 13:52:49 +02:00
Huy Nguyen 1b500e407f Fix comment in ASTableView 2015-10-26 08:37:17 +02:00
appleguy 7e616756a7 Merge pull request #722 from nguyenhuy/RelayoutCellAPI
Add relayout item/row APIs to ASTableView and ASCollectionView
2015-10-25 21:28:20 -07:00
Huy Nguyen 5ea4b1b92d Implement ASChangeSetDataController. 2015-10-26 06:22:30 +02:00
appleguy 8dddcaa74b Merge pull request #766 from levi/levi/synchronous-reloaddata
Add synchronous reloadData methods to ASTableView and ASCollectionView
2015-10-25 21:05:52 -07:00
Huy Nguyen 7533118945 Fix unnecessary relayout if table view width is zero initially
- During initial configuration of a table view with a zero size, for each cell, there is a mismatch between the widths of its content view and constrained size. However, don't relayout the cell immediately because an initial data loading will be performed shortly afterward.
2015-10-25 18:54:11 +02:00
Huy Nguyen 52a259a487 Better names in ASTableView. 2015-10-25 18:30:51 +02:00
Levi McCallum 722b90f1cf Implement basic immediate reloadData method on table and collection view 2015-10-22 21:28:44 -07:00
Levi McCallum fddb0061b0 Use ASCellNodes for supplementary nodes 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 1c2046cdf4 Localize debugging LOG definition 2015-10-15 11:40:50 -07:00
Levi McCallum ed1b737ead Define initial supplementary node creation behavior 2015-10-15 11:40:48 -07:00
Levi McCallum e9eadac4ae Stub out ASCollectionDataController subclass 2015-10-15 11:40:48 -07:00
Vitaly Baev 03542c5436 Bump the bracket down 2015-10-15 20:01:55 +03:00
Vitaly Baev 8557d65104 ASCellNode selected/highlighted properties 2015-10-15 13:25:12 +03:00
Huy Nguyen 12c087d967 Merge branch 'master' into RelayoutCellAPI 2015-10-12 21:31:49 +03:00
Scott Goodson a8435b494c Revert "Properly support operating with nil asyncDelegate for Table & Collection."
This reverts commit 77745c55b0.

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
Huy Nguyen f13f61c2f0 Add relayout item/row APIs to ASTableView and ASCollectionView. 2015-10-07 21:25:07 +03: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
Steven Ramkumar d09888f9c2 Add a indexPathForNode: to ASTableView 2015-09-22 12:09:56 -07:00
Huy Nguyen 094d2570f5 Force the layout of subviews when _ASTableViewCell transitioned to another state
Relayout will be triggered in layoutSubviews (if needed).
2015-09-16 15:25:40 +03:00
Huy Nguyen 2d575fcafc Relayout table view cell nodes if there is a mismatch between content view size and the node's constrained size
- Above is the generic case. Correctly handling it means relayout when the table view enters or leaves editing mode is solved as well.
- Async data source API removal: In a table view, cell nodes should always fill its content view and table view widths. Thus async data source can no longer provide custom constrained size for cell nodes. This removal allows table view to better handle relayout.
- Some more tests are added to ASTableViewTests to check against use cases handled in this diff.
2015-09-16 11:41:34 +03:00
Huy Nguyen a8cecbd0ad Avoid doing relayout during initial configuration of table and collection views. 2015-09-08 22:43:28 +03:00
Huy Nguyen 641929c4e5 By default, cell nodes in table view should fill its width. So the min constrained width is updated to enforce this behaviour. 2015-08-21 17:43:40 +03: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
Huy Nguyen 219b659b38 - Automatically relayout cells when editing mode is used.
- Add editing mode to Kitten sample.
2015-08-09 00:45:54 +03:00
Huy Nguyen e657bedd40 Automatically relayout cells after orientation changed. 2015-08-09 00:36:58 +03:00
Ethan Nagel bf0766169b PR Feedback: Require main thread for all edit commands, various cleanup. 2015-07-20 22:08:19 -07:00