37 Commits

Author SHA1 Message Date
rcancro
b4a6f87ca6 addressed some comments 2016-05-10 14:44:32 -07:00
rcancro
8bb4eba080 Initial attempt at implementing Display Traits
Initial attempt to get display traits working with ASEnvironment.

To get proper ASDisplayTraits support, you must use an ASViewController. The ASViewController implements UITraitCollection-related methods (`traitCollectionDidChange:`, `willTransitionToTraitCollection:withTransitionCoordinator:`, viewWillTransitionToSize:withTransitionCoordinator`) to update the internal ASDisplayTraits and propagate them to subnodes.

ASTableNode and ASCollectionNode don't actually have their cells as subnodes, so a little bit of trickery is involved (on `setEnvironment:` the table/collection node gets its data controllers completedNodes and propagates the new traits. see `ASDisplayTraitsCollectionTableSetEnvironmentState`). The data controller also passes the current display traits when creating new cells.

ASViewController also supports the ability to return a custom set of display traits. So if you have a modal dialog that should always be told it is in a compact size class, you can set the override block before displaying the VC.

A new example, called Display Traits, has been added. It shows how display traits can be used in a ASViewController with a normal ASDisplayNode as its root, as well as in ASViewControllers hosting table nodes and collection nodes. There is also an example of overriding the default display traits of a VC.

Please provide feedback!
2016-05-10 14:44:22 -07:00
Michael Schneider
9fdce828c1 Small improvements for ASLayoutSpec
- Add nullable for returning children
- Store default child and children as properties
- Use vector for creating final children
2016-04-15 07:11:24 -07:00
Scott Goodson
8ccef1e99f [ASEnvironment] Fix incomplete gating of upward propagation of layout properties (disabled for now). 2016-04-11 20:34:24 -07:00
Michael Schneider
45d50624d1 Fix disabled state propagation for final layoutable 2016-04-11 17:41:48 -07:00
Hannah Troisi
dbad1c38e5 [ASEnvironment - Layout] Fixes to upward propagation of ASLayoutable properties. 2016-04-02 15:03:43 -07:00
Michael Schneider
20ee9bca8d Rename ASEnvironmentStateCreate to ASEnvironmentStateMakeDefault 2016-03-31 20:43:20 -07:00
Michael Schneider
5baab95506 Add up propagation of ASEnvironmentLayoutOptionsState in ASLayoutSpec while setting a child 2016-03-31 20:43:20 -07:00
Michael Schneider
f46f5640ff Add improvements
- Remove defaults for ASEnvironmentLayoutOptionsState and ASEnvironmentHierarchyState
- Add locking for ASEnvironmentLayoutExtensibilityForwarding
- Other smaller improvements
2016-03-31 20:43:20 -07:00
Michael Schneider
4e757f0969 General improvements
- Refactor naming of ASEnvironmentCollection to ASEnvironmentState
- Remove struct pointers
- Move ASEnvironmentStatePropagation to a enum class
- Move merge functions to pure functions
- Move ASLayoutOptionsForwarding and ASLayoutableExtensibility into ASLayoutSpec and ASDisplayNode
- Remove ASLayoutableSetValuesForLayoutable and move into explicit classes (ASDisplayNode, ASTextNode)
2016-03-31 20:43:20 -07:00
Michael Schneider
65b4961802 Add extensibility support for ASEnvironmentLayoutOptionsState 2016-03-31 20:43:20 -07:00
Michael Schneider
96df35e41a Initial commit for ASEnvironment 2016-03-31 20:43:20 -07:00
Scott Goodson
0feaa2a368 Improvements to the efficiency of recursivelySetInterfaceState: and the beta range controller. 2016-01-10 02:40:47 -08:00
Scott Goodson
a2cf2a88e6 Overhaul header files / includes to eliminate circular references that Xcode 7 is angry about. 2015-12-25 19:22:00 -08:00
Scott Goodson
6d8bad13c0 Fix crash in ASCII art creator for one-element children arrays 2015-11-08 19:04:16 -08:00
rcancro
050160e6bb fixed the build again (removed all generic collections) 2015-10-19 10:04:49 -07: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
rcancro
7e3a0b3223 Changed copyIntoOptions to copyFromOptions
I thought I already did this. I think copyFrom is a better name.
2015-09-16 14:33:54 -07:00
rcancro
2d30a81a75 added documentation 2015-09-15 11:05:30 -07:00
rcancro
2e3d59a73e spelling 2015-09-11 16:13:18 -07:00
rcancro
b14e189bfb Addressed comments to LayoutOptions PR 2015-09-11 16:07:18 -07:00
rcancro
b85316d8bc a couple comment updates 2015-09-10 13:19:13 -07:00
rcancro
23497379e4 added comment to give guidance if a user is getting crashing in finalLayoutable 2015-09-09 11:51:36 -07:00
rcancro
2a030c9841 First thoughts on fixing the finalLayoutable method. 2015-09-09 09:13:02 -07:00
rcancro
b3369ca388 making ASLayoutOptions threadsafe 2015-09-08 09:50:47 -07:00
rcancro
fca43a651f Make layoutOptions readonly 2015-09-08 09:50:47 -07:00
rcancro
5786bc1b5b Fixed infinite recursion in finalLayoutable, removed child properties from ASLayoutSpecs 2015-09-08 09:50:47 -07:00
rcancro
36d00273fb wasn't copying layout options to final layoutable. 2015-09-08 09:50:47 -07:00
rcancro
8263a9f53a Kittens sample working 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
rcancro
680305704a addressed comments and fixed tests 2015-08-21 21:03:40 -07:00
rcancro
c06a6be188 ASLayoutSpec are temporarily mutable and have a more obj-c interface 2015-08-21 16:02:36 -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
2149d44990 Fix naming convetion:
- "Layout node" is changed to "layout spec".
- Update tests.
- Update Kittens sample.
2015-07-01 18:13:44 +07:00