247 Commits

Author SHA1 Message Date
Adlai Holler
171cc2f527 Improve Automatic Subnode Management Node Ordering (#2589)
* Add failing tests for subnode ordering

* Ensure that subnode ordering matches layout spec tree ordering
2016-11-10 09:22:53 +09:00
appleguy
55b5dff80c [ASLayoutSpec] Initial commit to support visualizing layout specs (with Playground app). (#2554)
* Initial ASLayoutSpecPlayground commit

* Initial exploratory stab at the main challenge of the app - visualizing ASLayoutSpecs

* Halfway through moving debug features out of ASDK framework files and into debug files. Project builds.

* [ASLayoutSpecPlayground] Created new Inspector node, cleaning up internal implementation to start formalizing support for layout spec visualization.

* Workaround for ensuring creation of visualizerNode for ALL layoutspecs

* continued development

* Layout Inspector Work in Progress

* Resizing the playground works in the shrink direction, not for grow.

* added new ASLayoutableInspectorNode features

* Cleaned up examples code.

* Cleaning up  code.

* more code cleanup

* [ASLayoutableInspector] Transition to an ASTableNode-based architecture to support larger numbers of buttons / customizable types.

* [ASLayoutableInspector] Support different layoutable property types to set up buttons that can edit all of them.

* Huy debugging

* Refactored layout inspector code for extensibility.

* Properly lock layoutableContextMap

* Fix context handling in ASDisplayNode:measureWithSizeRange

* Fix ASLayoutSpecPlayground:ViewController:toggleVisualization

* added slider to InspectorCell

* [ASLayoutSpecPlayground] Improvements to propagation of visualize mode, resize handle, minor cleanup.

* Fix to ASEnvironment

* [ASLayoutSpecPlayground] Fix a few minor issues from the merge with latest master.

* Implement layout spec cache

* add pager ndoe

* add more examples

* add more layout examples

* [ASLayoutPlayground] Fix merge issues

* [ASLayoutPlayground] Fix up the example project from the 2.0 API changes.

* [ASLayoutPlayground] Some fixes (#2411)

* [ASLayoutPlayground]: Some fixes
* Fixed crash when tapping descender.
* Fixed setting the item to inspect.
* Fixed button states in inspector node.
* Added sliders for spacingBefore, spacingAfter, ascender.

* [ASLayoutSpecPlayground] Deselect the buttons when editing is over.

* [ASLayoutSpecPlayground] Changed flexGrow/Shrink's values from YES/NO to 1.0/0.0

* [Project] Create new Debug/ directory for advanced tools dedicated to debugging.

* [LayoutSpecPlayground] Rename project without AS in title, to be consistent with LayoutSpecExamples.

* [Bulid] Fix Xcode project to use new Debug subdirectory / group.

* [Bulid] Fix a small merge error.

* [Build] Fix build issue for Framework target.

* [Bulid] Fix podspec to expose InspectorNode header; Remove old-cocoapods emojis from ASDKgram :)

* Move aside ASLayoutSpecPlayground-Swift to match master

* [LayoutSpecPlayground] Cleanup implementation in several files, xcodeproj, etc.

* [ASControlNode] Add comment for new assertion, to be enabled in a separate diff.
2016-11-08 20:16:16 -08:00
Garrett Moon
cc00626642 Fix Carthage build (#2567) 2016-11-07 15:54:23 -08:00
Scott Goodson
d7ba0a9c6d [Build] Add imports that are necessary for clang to parse header files after compilation.
This allows the objc-diff tool (which creates API diffs) to run successfully.
2016-11-06 15:04:30 -08:00
Michael Schneider
de36ef29bd Fix height check in ratio layout spec (#2553) 2016-11-05 18:45:42 -07:00
george-gw
ff9e493a59 Fixed asciiArtString. (#2523) 2016-11-01 17:33:27 -07:00
Hannah Troisi
8e6f842b8d [ASLayoutElementStyle] implement -description with sizing info (#2495)
* Layout style object debugging

* Remove cocoapods crap
2016-11-01 07:58:43 -07:00
Garrett Moon
68990cb6cc Deprecations should be re-enabled. If there are specific deprecations… (#2519)
* Deprecations should be re-enabled. If there are specific deprecations we'd like to hold off on, we should address those specifically.

* Fix decleration

* Move select to undeprecated

* Fix deprecations
2016-10-31 17:30:40 -07:00
Michael Schneider
4464b7de60 Improve deprecation situation for 2.0 (#2514)
* Improve deprecations for 2.0

- Add deprecations for node / layoutSpec style properties
- Implement missing methods on ASDisplay from deprecation header
- Cleanup all of the deprecation categories

* Remove DeprecatedProtocolMethods

* Fix "Life without Cocoapods"

* Update comments
2016-10-31 16:46:21 -07:00
Garrett Moon
9aeef7b503 Revert "We need to ensure point dimensions are valid for sizing. (#2503)" (#2512)
This reverts commit 1165628905f92aa00c1605230f32953f5d7f0670.

I wanted to catch dimension issues early, we should move the assert to setting
width and height. The former was correct for here.
2016-10-31 00:02:50 -07:00
Michael Schneider
611894329a [ASStackLayoutSpec] Performance improvements (#2470)
* Initial commit for ASStackLayoutSpec improvements

* Remove the lock in ASStackLayoutSpec and make the ASStackLayoutSpecStyle const

I think we don't need lock here as the style already has a lock while we set the value

* Add ASStackLayoutSpecItem  that replaces layout specific items

* Prevent baseline pass if not needed

* Update comments
2016-10-30 12:07:18 -07:00
Michael Schneider
fb92b448e0 [ASDisplayNode] Proper handling of constrainedSize (#2505)
* Check in ASLayout if size is valid for sizing instead of valid for layout

* Return constrainedSize from calculateSizeThatFits:

Remove invalid constrainedSize check within ASNetworkImageNode. Furthermore as ASDisplayNode does not return CGSizeZero anymore we have to give the display nodes we use in tests and are involving a stack spec an intrinsic content size.

* Remove extra constrainedSize handling in ASNetworkImageNode handling

* Change test to use FLT_MAX
2016-10-28 15:39:03 -07:00
Garrett Moon
1165628905 We need to ensure point dimensions are valid for sizing. (#2503) 2016-10-28 15:18:45 -07:00
Michael Schneider
eb6cf0689d Only throw if ASLayoutElement style width or height are ASDimensionUnitFraction (#2484) 2016-10-26 17:17:09 -07:00
Michael Schneider
d4af95c9f1 Add ASLayoutSizeAuto (#2478) 2016-10-26 11:43:14 -07:00
Michael Schneider
6d5bd6e969 Cleanup calculateLayoutThatFits: (#2480) 2016-10-26 11:26:57 -07:00
Michael Schneider
2a1f7815cc Set sublayout to CGPointZero in ASWrapperLayoutSpec (#2476) 2016-10-24 19:02:03 -07:00
Michael Schneider
4e580b96dc Add support for multiple children to ASWrapperLayoutSpec (#2469) 2016-10-24 09:59:44 -07:00
Scott Goodson
30a7edf30f [ASLayout] Remove new ASLayoutPrivate.h file and put contents into ASLayoutSpec+Subclasses.h 2016-10-21 13:23:05 -07:00
appleguy
2c6f8b0506 [AsyncDisplayKit 2] Final changes to ease migration of clients to 2.0 APIs. (#2460) 2016-10-21 13:12:13 -07:00
Hannah Troisi
9719357901 [ASLayoutElement] Move ASDisplayNode's .name property to ASLayoutElement (renamed to .debugName) (#2395)
* Move ASDisplay .name property to ASLayoutElement

* keep ASDisplayNode.name deprecated

* address @appleguy's comments
2016-10-20 17:27:31 -07:00
Hannah Troisi
84d1a637d7 [2.0] add helpful deprecation messages (#2437)
[2.0] add helpful deprecation messages
2016-10-19 14:48:06 -07:00
Michael Schneider
4b914f8e15 Add preferredSize as getter to ASLayoutElementStyle (#2427) 2016-10-19 12:55:19 -07:00
Michael Schneider
abd80494c7 [ASLayoutElementStyle] ASLayoutElementStyle improvements (#2413)
* Use std::atomic for properties in ASLayoutElementStyle

* Remove setter calls for min / max width and height in ASLayoutElementStyle
2016-10-18 15:55:55 -07:00
Michael Schneider
56d50e6d5e Add ASAbsoluteLayoutSpecSizing (#2394)
Add ability for ASAbsoluteLayoutSpec to grow as far as possible or shrink to fit it's children
2016-10-18 13:55:13 -07:00
Michael Schneider
ba80b83695 [ASRelativeLayoutSpec] Fix ASRelatativeLayoutSpec behavior for ASRelativeLayoutSpecPositionStart (#2393)
* Fix ASRelatativeLayoutSpec behavior for ASRelativeLayoutSpecPositionStart

* Add updated images for snapshot tests
2016-10-18 12:00:01 -07:00
Adlai Holler
6e76daf279 [Layout] Check Layout Spec Tree for Duplicated Elements (#2408)
* Check layout spec tree for duplicated elements

* Enable layout spec tree dedupe only in debug
2016-10-18 09:33:37 -07:00
Michael Schneider
9f1643ebfd Final size should always be in constrainedSize in ratio spec (#2403) 2016-10-18 09:18:40 -07:00
Michael Schneider
d407663e3f [ASLayout] Improve ASLayout (#2404)
* Add internal header for ASLayout and change position to readonly publicly

* Don't copy sublayouts during tree filtering

* Revert "Don't copy sublayouts during tree filtering"

This reverts commit 6b0d54d5ffe5bb3941ec13696c9c45b0098b6ba1.
2016-10-18 08:36:38 -07:00
appleguy
11293d545a [ASLayout - Performance] Avoid weak ivar access & method call to check layoutElementType. (#2397)
* [ASLayout - Performance] Avoid weak ivar access & method call to check layoutElementType.

This shows up in benchmarking profiles for layout-bound workloads.

* Add comment
2016-10-17 12:23:45 -07:00
Michael Schneider
3f11c67c82 Return CGSizeZero in case a ASNetworkImageNode is asked for the size and the image did not load yet (#2378) 2016-10-13 14:03:15 -07:00
Michael Schneider
8491155fb4 Add locking for ASStackLayoutElement and ASAbsoluteLayoutElement (#2371) 2016-10-12 13:40:53 -07:00
Michael Schneider
8f8df537d2 Rename ASRelativeSize to ASLayoutSize (#2369) 2016-10-11 16:36:40 -07:00
Michael Schneider
507bc55504 [Layout] Add ASLayoutElementStylability protocol (#2366)
* Add ASLayoutElementStylability protocol

* Rename to styledWithBlock:, add instancetype and add noescape
2016-10-11 09:16:18 -07:00
Adlai Holler
c72b2b212c Tiny change to the doc for ASDimensionMake (#2362) 2016-10-07 10:00:58 -07:00
Hannah Troisi
a79e0be016 quick renaming (#2358) 2016-10-07 09:32:38 -07:00
Michael Schneider
bb7118a26a Fix ASAbsoluteLayoutSpec creation children protocol (#2357) 2016-10-06 20:37:12 -07:00
Michael Schneider
6f2c7caac3 [Layout] Improve ASDimensionMake via NSString (#2351)
* Improve ASDimensionMake via NSString

- ASXCTAssertEqualDimensions
- Add support for "auto"
- Assert if given an empty or invalid string

* Address comments

* Add ASCGFloatFromString and ASCGFloatFromNumber

* Rename CGRect+ASConvenience to CoreGraphics+ASConvenience
2016-10-06 16:29:33 -07:00
Michael Schneider
166414dfc9 [Layout] Lazy initialize ASLayoutElementStyle in ASDisplayNode and ASLayoutSpec (#2352)
* Lazy initialize `ASLayoutElementStyle` in `ASDisplayNode`

* Lazy initialize `ASLayoutElementStyle` in `ASLayoutSpec`
2016-10-06 16:53:40 -04:00
Adlai Holler
124234fef8 [Umbrella] Add warn_unused_result Attribute to Public Headers (#2353)
* Add some warn_unused_result attributes

* Add more

* Add some more
2016-10-06 16:44:49 -04:00
Michael Schneider
271ab20de5 Fix ASDimension creation of type ASDimensionUnitFraction via a NSString (#2347) 2016-10-05 18:30:24 -07:00
Michael Schneider
d6e5e27c39 [Layout] Add helper properties for setting sizes via CGSize and ASRelativeSize (#2324)
* Remove set layout style size helper

* Update API to set and get a CGSize / ASRelativeSize from an ASLayoutElementStyle

- Expose ASRelativeSize type
- Add new helper properties to set a size / relative size to ASLayoutElementStyle
- Don't expose the size in ASLayoutElementStyle anymore and move into ASLayoutElementStylePrivate

* Update examples

* Update comments for size helpers
2016-10-04 12:35:45 -04:00
Hannah Troisi
47f73576ef [Layout] Rename ASStackLayoutable to ASStackLayoutElement (#2322)
* redo all renaming, push new branch

* rename a few missed occurances of static
2016-09-29 12:29:21 -07:00
Hannah Troisi
7551627b58 [Layout] Rename ASLayoutable to ASLayoutElement (#2290)
* [Layout API] Rename ASLayoutable to ASLayoutElement

* arg

* fix wrapperWithLayoutElement

* [Layout API] Rename ASLayoutable to ASLayoutElement

* arg

* address Michael's comments

* Remove ASLayoutValidation files that were deleted on master since this diff was created.
2016-09-29 00:02:47 -07:00
Michael Schneider
1abc1a833c Remove legacy layout validation code (#2311) 2016-09-28 16:46:31 -07:00
Hannah Troisi
87595c7d3b [Layout API] Rename ASStaticLayoutSpec to ASAbsoluteLayoutSpec (#2288)
* Rename static to absolute

* Fix examples, rename ASAbsoluteLayoutSpec class method

* rename +staticLayoutSpecWithChildren to +absoluteLayoutSpecWithChildren

* address Michael's comments
2016-09-28 13:05:31 -04:00
Michael Schneider
2f99951732 [Layout] Move [ASLayoutSpec children] from std::map to NSMutableArray (#2253)
* Initial commit to move [ASLayoutSpec children] from std::map to NSMutableArray

* Add NSFastEnumeration to ASLayoutable

* ASNullLayoutSpec is a Singleton now

* Move ASLayoutSpecPrivate in Private folder

* Move to NSArrayPointer and remove ASNullLayoutSpec

* Revert "Move to NSArrayPointer and remove ASNullLayoutSpec"

This reverts commit 9ab9cf7024b1f6e1984d84fe58af2b84e84cdf94.

* Move to childAtIndex: and setChild:atIndex:
2016-09-27 19:41:45 -04:00
Michael Schneider
e85583523f [Layout] Add support for flex factor (#2298)
* Add support for flex factor

* Add snapshot tests

* Respect child specified size from ASLayoutable

* Add new snapshot test images

* Fix rebase conflict
2016-09-27 18:39:50 -04:00
Michael Schneider
416d8f92e1 [Layout] Add delegate to ASLayoutableStyle for property changes (#2283)
* Add delegate to ASLayoutableStyle for property changes

* Moving ASLayoutableStyle delegate to readonly

* Add ASLayoutableStyleTests

* Fix property stirngs

* Fix video example

* Address comments of Adlai
2016-09-27 16:50:36 -04:00
Michael Schneider
9f55de2c6c Remove styleClass property from ASLayoutable for now (#2279) 2016-09-23 09:30:17 -07:00