110 Commits
Author SHA1 Message Date
Huy Nguyen cd31f884dd Move ASDisplayNodePerformBlockOnMainThread to ASInternalHelpers 2015-10-29 16:09:36 +02:00
Huy Nguyen b77522bf4f Remove debugging names of ASDisplayNode and _ASDisplayLayer
- They are neither considered internally nor in tests. And when they are accidently considered, they cause tests to fail.
- Developers can easily set debugging names themselves whenever needed.
2015-10-26 07:44:59 +02:00
Huy Nguyen 53a3b76d6d Add read-only names to UIView and CALayer
- Backed by name of the underlying ASDisplayNode.
- Remove goofy usages of `setValue:forKey:` in ASDisplayNodeTests and ASDisplayNodeAppearanceTests.
2015-10-26 07:44:05 +02:00
Huy Nguyen fd0b3aaf52 Revert "Revert "Make ASDisplayNode.name Thread Safe""
This reverts commit 906d7c759b.
2015-10-26 06:29:01 +02:00
rcancro f164b97700 Put all ascii box methods into a Debugging category. 2015-10-19 08:32:14 -07:00
rcancro 3b983c5a50 Ascii art for layoutables 2015-10-16 16:15:29 -07:00
Huy Nguyen c2fbd651da Lock the property lock in ASDisplayNode __setSafeFrame 2015-10-07 22:21:43 +03:00
Huy Nguyen 8b7dc916f8 Fix indentations in ASDisplayNode:layout 2015-10-07 22:16:37 +03:00
Huy Nguyen 5a2fea7c1d Use bounds and position to layout subnodes, instead of frame because it is not safe in case the transform property constains a non-identity transform. 2015-10-07 21:54:48 +03:00
Garrett Moon 8a70c8d416 Adds support for disabling and re-enabling should rasterize. 2015-10-06 11:47:13 -07:00
appleguy fd88522f84 Merge pull request #636 from nguyenhuy/fixSetNeedsLayout
Use getters and setters while adjusting position of a node
2015-10-01 18:08:28 -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
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
Huy Nguyen 4b82cc4051 While adjusting position of a node, use getters and setters. Those methods already check thread affinity and layer readiness. 2015-09-02 20:29:50 +03: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