370 Commits

Author SHA1 Message Date
ricky cancro
eae76d26b7 Add expectedSize to ASNetworkImageNode
ASNetworkImageNode defers to ASImageNode to return its calculatedSize. ASImageNode returns the size of its image. There is a good chance that ASNetworkImageNode hasn't downloaded its image yet when calculatedSize is called, so it returns a size of CGSizeZero.

On top of that, it is possible that the size of the image is not actually the size that we wish to display in our node.

I've added an "expectedImageSize" property that can be used to determine the calculatedSize of an ASNetworkImageNode.
2015-07-30 16:50:11 -07:00
Connor Montgomery
ca5e9e7dc3 Add support for configuring on ASEditableTextNode. 2015-07-30 15:19:00 -04: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
Ethan Nagel
9762e7cfe6 short-circuit editing calls after the asyncDataSource has been set to nil (ASTableView) 2015-07-16 20:26:28 -07:00
Huy Nguyen
3992e9b09b [appledoc] Fix all remaining warnings. 2015-07-12 17:27:44 +07:00
Huy Nguyen
75983ca3e5 Merge branch 'master' into clean_up_layout_spec 2015-07-12 08:17:36 +07:00
Ryan Fitzgerald
4383e9ab2b releasing downloaded image when multiplex image node exits render range 2015-07-11 09:27:01 -04:00
Huy Nguyen
e1fd58268c Clean up #468:
- -layoutSpecThatFits: must return an ASLayoutSpec.
- Move ASDisplayNode's -measureWithSizeRange: redeclaration to ASDisplayNode.h.
- Rename ASStackLayoutChild.h to ASStackLayoutDefines.h.
- Rename ASStaticLayoutSpecDimension.h to ASRelativeSize.h.
- Don't import ASLayout.h in other headers to prevent circular inclusions.
- Explain use cases of ASLayout's initializers.
- Clean up ASInternalHelpers.h.
2015-07-10 19:41:17 +07:00
Huy Nguyen
cfac6c992a [appledoc] Fix appledoc warnings. (#553) 2015-07-10 19:02:04 +07:00
Ryan Fitzgerald
83ac5ad823 changing layoutableObject to be a weak reference to avoid retain cycle between ASDisplayNode and its Layout 2015-07-08 09:58:31 -04:00
Bogdan Iusco
a0fcecc469 Fix duplicate symbols on ASIndexPath 2015-07-07 18:23:04 +03:00
Huy Nguyen
9678adaa93 Merge branch 'master' into layout_node 2015-07-06 22:21:32 +07:00
Huy Nguyen
51f1ed819f - ASDisplayNode now caches calculated layout requested by layout specs.
- constrainedSizeForCalculatedLayout is of type ASSizeRange.
- calculatedLayout is better explained.
- Since ASLayout is cached and reused, its position property is mutable.
2015-07-06 22:08:01 +07:00
Huy Nguyen
772ed0b019 Fix import in ASCellNode. 2015-07-06 09:15:13 +07:00
appleguy
3f574a3306 Merge pull request #521 from jflinter/jack-uiresponder-additions
Add UIResponder methods to ASDisplayNode
2015-07-04 22:36:09 -07:00
appleguy
58a55f035d Merge pull request #529 from facebook/DataControllerQueues
Overhaul ASDataController and extensively test ASTableView.
2015-07-04 21:06:34 -07:00
Scott Goodson
6220d65747 Property declaration tweak for odd Travis build failure (only on the Tests build). 2015-07-04 20:54:04 -07:00
Scott Goodson
8fa092fb77 Complete overhaul of ASFlowLayoutController.
Introduced ASIndexPath for efficient handling of index paths in C++ vectors,
while maintaining the readability of ".section" and ".row" instead of
".first" and ".second" inside of complicated business logic.

Confirmed that the working range calls are firing appropriately during
ASTableViewStressTest, including the deallocation of the rich text placeholders
provided by ASTextNode.
2015-07-04 20:22:04 -07:00
Huy Nguyen
af64f33ed7 Minor changes: remove unncessary imports and add a new line ad the end of ASInternalHelpers.h 2015-07-01 18:36:36 +07:00
Huy Nguyen
2a3753516a Fix naming convention: Rename ASLayout's "children" to "sublayouts". 2015-07-01 18:13:54 +07:00
Huy Nguyen
2149d44990 Fix naming convetion:
- "Layout node" is changed to "layout spec".
- Update tests.
- Update Kittens sample.
2015-07-01 18:13:44 +07:00
Huy Nguyen
eb5670032d ASDisplayNode flattens the ASLayout calculated from its layout spec and stores the result. This reduces memory footprint and gives -layout a performance gain. 2015-06-30 20:18:11 +07:00
Huy Nguyen
4799a9d206 Remove ASLayoutChild. ASLayout now has a position property defaults to (NAN, NAN). 2015-06-30 19:42:38 +07:00
Ethan Nagel
4963a88717 Propagate ASCellNode's clipsToBounds value to the __ASTableViewCell. This helps work around a bug we are seeing in some rare cases (selected background view overlaps other cells if size of ASCellNode has changed.) 2015-06-29 21:22:55 -07:00
Scott Goodson
57465c7fd3 Overhaul ASDataController and extensively test ASTableView.
This diff resolves all known consistency issues with ASTableView and ASCollectionView.
It includes significantly more aggressive thrash-testing in ASTableViewStressTest,
which now passes on a variety of device and simulator configurations.  It also updates
the unit tests run on every commit to ensure any regression is caught quickly.

A few of the salient changes in this diff:
- ASTableView now uses Rene's ASCollectionViewLayoutController, and actually uses a
UICollectionViewFlowLayout without any UICollectionView.  This resolves an issue where
ASFlowLayoutController was generating slightly out-of-bounds indicies when programmatically
scrolling past the end of the table content.  Because the custom implementation is likely
faster, I will revisit this later with profiling and possibly returning to the custom impl.
- There is now a second copy of the _nodes array maintained by ASDataController.  It shares
the same node instances, but this does add some overhead to manipulating the arrays. I've
filed a task to follow up with optimization, as there are several great opportunities to
make it faster.  However, I don't believe the overhead is a significant issue, and it does
guarantee correctness in even the toughest app usage scenarios.
- ASDataController no longer supports calling its delegate /before/ edit operations.  No
other class was relying on this behavior, and it would be unusual for an app developer to
use ASDataController directly.  However, it is possible that someone with a custom view
that integrates with ASDataController and ASRangeController could be affected by this.
- Further cleanup of organization, naming, additional comments, reduced code length
wherever possible.  Overall, significantly more accessible to a new reader.
2015-06-28 18:03:45 -07:00
Huy Nguyen
e74823bbee Merge branch 'master' into layout_node 2015-06-28 23:47:09 +07:00
Huy Nguyen
dd29a890df Still support -calculateLayoutThatFits: (and manual layout), for backward compatibility. 2015-06-28 20:31:32 +07:00
appleguy
8beae28b25 Merge pull request #506 from paulyoung/framework-target
Remove old and add new framework target.
2015-06-27 21:58:09 -07:00
Scott Goodson
feba7f8ed1 Update the identifier that AsyncDisplayKit uses to label its internal queues (2/2). 2015-06-27 12:10:58 -07:00
Scott Goodson
dc19970fe8 Clean up organization and naming of methods internal to ASDataController. 2015-06-27 11:48:55 -07:00
Scott Goodson
06cfe68cbd Clean up ASDataController for readability & API naming consistency. 2015-06-27 11:06:54 -07:00
Jack Flintermann
8a200078bd make ASEditableTextField properly subclass responder methods 2015-06-27 03:19:51 -04:00
Jack Flintermann
540eeec79b move UIresponder methods out of UIView bridging category 2015-06-27 03:19:51 -04:00
Jack Flintermann
0b14d42033 add UIResponder methods to ASDisplayNode 2015-06-27 03:19:51 -04:00
Paul Young
7d464fb6b8 Merge branch 'master' into framework-target
Conflicts:
	AsyncDisplayKit.xcodeproj/project.pbxproj
2015-06-26 23:31:43 +01:00
appleguy
da4ae469d8 Merge pull request #514 from eanagel/astableview-programmatic-scrolling-fix-v3
ASTableView programmatic scrolling fix w/contiguous guarantee
2015-06-26 13:18:54 -07:00
Huy Nguyen
95e787b226 Remove stack children type:
- ASLayoutable requires mutable properties that are used when attached to a stack layout.
- Thus, ASLayoutable objects (including ASDisplayNode) can be injected into stack layout directly.
- ASStackLayoutNodeChild no longer needed.
- Tests and Kitten sample updated.
2015-06-26 11:47:42 +07:00
Huy Nguyen
f588bceb4d Introduce ASLayoutable and eliminate ASCompositeNode:
- Both ASDisplayNode and ASLayoutNode conforms to this protocol.
- ASDisplayNode can be embeded directly into layout graph.
- Eliminate ASCompositeNode.
- Fix ASStaticSizeDisplayNode not recpect min constrained size.
- Updated tests.
2015-06-26 09:29:16 +07:00
Ethan Nagel
ae523f4fce better logic for detecting when the pending index path is before or after the visible index paths 2015-06-25 09:53:36 -07:00
Huy Nguyen
99fe79339d Simplify ASDimension:
- ASRelativeSize and ASRelativeSizeRange are used only by ASStaticLayoutNode. They are declared in a standalone header.
- ASDimension contains a minimal set of new size types required to use the common layouts. Thus minimize the learning curve.
2015-06-25 11:36:02 +07:00
Huy Nguyen
259bbf22bc Fix naming conventions on equal and resolve methods of new size types. 2015-06-25 11:34:37 +07:00
Huy Nguyen
93564899fd Remove Auto size type. 2015-06-25 11:34:37 +07:00
Huy Nguyen
810bc3ab84 Rename ASLayoutNode's -computeLayoutThatFits to -calculateLayoutThatFits. 2015-06-25 11:34:37 +07:00
Huy Nguyen
64e2323a4e Remove ASLayoutNodeSize:
- ASLayoutNode no longer has 'size' constraint during its initialization..
- ASLayoutNode no longer needs parentSize to calculate its layout.
2015-06-25 11:34:36 +07:00
Huy Nguyen
90a78684c9 Revert to using ASDisplayNodeSubclassOverridesSelector, to minimize changes and provide a bit of convenience within ASDisplayNode. 2015-06-25 11:34:36 +07:00
Huy Nguyen
aea91fff86 Fix typo in ASDisplayNode. 2015-06-25 11:34:36 +07:00
Huy Nguyen
abe98d5b09 Integrate new layout nodes to the framework.
- Introduce ASLayoutNode and its subclasses.
- ASDisplayNode measures its ASLayoutNode and cache the result (ASLayout). Calculated size and position of each subnode can be retrieved from the calculated layout.
- Custom nodes need to override -layoutNodeThatFits:(CGSize) instead of -calculateSizeThatFits:(CGSize).
- Custom nodes do not need to layout its subnodes (in -layout:) anymore. ASDisplayNode can handle the job most of the time, by walking through its layout tree.
- ASCompositeNode is used to embed (display) subnodes to a node's layout. That way, each subnode will also be measured while the parent node is measuring. And the parent node knows where its subnodes are within its layout.
2015-06-25 11:34:35 +07:00