97 Commits

Author SHA1 Message Date
rcancro
2f3562fa09 scott's comments 2015-09-15 09:11:19 -07:00
rcancro
01be5acece added a callback for initWithViewBlock/initWithLayerBlock 2015-09-14 20:36:08 -07:00
rcancro
b14e189bfb Addressed comments to LayoutOptions PR 2015-09-11 16:07:18 -07:00
Ethan Nagel
8ea40a0265 Merge branch 'master' into ASDisplayNode-init-perf
Conflicts:
	AsyncDisplayKit/ASDisplayNode.mm
	AsyncDisplayKit/Private/ASDisplayNodeInternal.h
2015-09-09 22:17:49 -07:00
rcancro
2a030c9841 First thoughts on fixing the finalLayoutable method. 2015-09-09 09:13:02 -07:00
rcancro
5786bc1b5b Fixed infinite recursion in finalLayoutable, removed child properties from ASLayoutSpecs 2015-09-08 09:50:47 -07:00
rcancro
cbaf178950 Hide ASLayoutOptions from the user 2015-09-08 09:50:47 -07:00
rcancro
15b3fd6eab Moved ASLayoutable* properties into ASLayoutOptions class 2015-09-08 09:50:27 -07:00
rcancro
7446578f6f Added method to ASLayoutable to allow a layoutable to override how it will be added to the layoutSpec.
Also moved ASStaticLayoutSpec to act more like the other layouts.
2015-09-08 09:49:40 -07:00
Ethan Nagel
a57f701a9e style fix 2015-09-08 09:44:54 -07:00
Ethan Nagel
ed5ebbe450 update documentation. 2015-09-08 09:32:56 -07:00
appleguy
de795d577a Merge pull request #635 from garrettmoon/fixShouldRasterizeSubnodes
Fix should rasterize subnodes
2015-09-03 01:28:43 -07:00
Garrett Moon
32582fca58 Fixes shouldRasterizeSubnodes
Currently, subnodes of nodes marked with shouldRasterizeSubnodes do not get layout calls. This adds the call to layout and changes the __layout method to reference self.bounds instead of _layer.bounds.

Also adds support for corner radius when rasterizing subnodes.
2015-09-01 13:25:27 -07:00
Huy Nguyen
075c39e398 When relayout a node, preserve its frame origin. 2015-08-27 21:16:39 +03:00
rcancro
c06a6be188 ASLayoutSpec are temporarily mutable and have a more obj-c interface 2015-08-21 16:02:36 -07:00
Ethan Nagel
36bac93a53 ensure class is not nil 2015-08-20 10:55:15 -07:00
Ethan Nagel
5dabd20b54 Merge branch 'master' into ASDisplayNode-init-perf
Conflicts:
	AsyncDisplayKit/ASDisplayNode.mm
2015-08-17 11:46:29 -07:00
Ethan Nagel
176e4962bf Perform one-time initializations in +initialize when possible 2015-08-14 14:41:13 -07:00
Huy Nguyen
1313c11519 preferredFrameSize should be used even if neither -layoutSpecThatFits: nor -calculateSizeThatFits: is overridden by subclassses. 2015-08-13 07:53:00 +03:00
Huy Nguyen
c7043a193c When a new preferredFrameSize is set, previously calculated layout should be invalidated so that the size will be picked up in the next layout pass. 2015-08-13 07:52:42 +03:00
appleguy
57291fa544 Merge pull request #590 from rcancro/master
Add expectedSize to ASNetworkImageNode
2015-08-12 15:51:57 -07:00
appleguy
91bffc8ca2 Merge pull request #602 from shannonma/merge_fork
Fix race in ASDisplayNodeRespectThreadAffinityOfNode
2015-08-12 11:40:21 -07:00
Shannon Ma
c26e9c7e94 Fix race in ASDisplayNodeRespectThreadAffinityOfNode 2015-08-10 16:42:02 -07:00
ricky cancro
b58e8344c0 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-08-09 16:34:44 -07:00
appleguy
d401b0e5f6 Merge pull request #593 from shannonma/merge_fork
Fixes for ASTextNode test, setNeedsDisplay and font loading failures
2015-08-08 18:55:00 -07:00
Huy Nguyen
77b586a7e6 Improvements on internal relayout. 2015-08-03 06:25:23 +03:00
Huy Nguyen
56768a837a - Support internal relayout, that is a relayout caused by internal layout changes, like subnodes re-arrangement and/or subnodes' size change. The constrained size applied to root node is unchanged.
- Update Kittens example to show how internal relayout is done.
2015-08-02 17:18:45 +03:00
Shannon Ma
15133fdbf7 setNeedsDisplay must be called on main 2015-07-31 12:11:19 -07: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
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
appleguy
3f574a3306 Merge pull request #521 from jflinter/jack-uiresponder-additions
Add UIResponder methods to ASDisplayNode
2015-07-04 22:36:09 -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
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
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
Scott Goodson
feba7f8ed1 Update the identifier that AsyncDisplayKit uses to label its internal queues (2/2). 2015-06-27 12:10:58 -07: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
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
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
Ian Cloutier
45f719fc6c Create pending nodes set lazily 2015-05-23 12:04:58 -04:00