47 Commits

Author SHA1 Message Date
Michael Schneider
2cd49642b9 Address comments from @appleguy 2016-11-19 06:43:46 -08:00
Michael Schneider
2744998a10 Further progress 2016-11-19 06:43:46 -08:00
Michael Schneider
b0eb2f81c2 Cleanup 2016-11-19 06:43:46 -08:00
Michael Schneider
e7fccb2363 Improve ASButtonNode layout invalidation 2016-11-19 06:43:45 -08:00
Michael Schneider
0f8eac4757 Some other commit 2016-11-19 06:43:45 -08:00
Hannah Troisi
3c995d8d12 [Examples] Layout 2.0 updates (#2382)
[Examples] Layout 2.0 updates: Switch YES to 1.0 for flexGrow and flexShrink
2016-10-15 17:30:48 -07:00
Hannah Troisi
3f42fcbc7d check button state before changing` (#2323) 2016-09-29 21:22:23 -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
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
f574f2c54e [Layout] Further deprecation steps for preferredFrameSize (#2255)
* Deprecate preferredFrameSize

- Remove all support for preferredFrameSize in ASDK
- preferredFrameSize setter calls through and sets the width and height of the node
- preferredFrameSize getter tries to return a CGSize based on the width and height properties otherwise if this is not possible it throws

* Address comments

* Return CGSizeZero for preferredFrameSize unless width and height are ASDimensionUnitPoints

* Better comment for preferredFrameSize and remove lock in calculateSizeThatFits:
2016-09-27 16:07:36 -04:00
Michael Schneider
75dca556e6 [Layout] Add style property to ASLayoutable (#2261)
* Add style property to ASLayoutable

* Add styles property to further layout specs

* Adjust some examples

* Add `loadStyle` to create the style object in a ASLayoutable

* Revert "Add `loadStyle` to create the style object in a ASLayoutable"

This reverts commit 2b7240f2c7dc993e38cadf290cfdf08482dd70c7.

* Revert "Adjust some examples"

This reverts commit 3254ae0a321e75db3ecfa80adee9d96bde93a33d.

* Revert "Add styles property to further layout specs"

This reverts commit c779dcb876ead27122c1af1300146a6ad36912cb.

* Rename ASLayoutableStyleDeclaration to ASLayoutableStyle

* Add styleClass class property for extensibility support of the ASLayoutable style object

* flexShrink should not be YES by default
2016-09-22 16:00:52 -07:00
Rocir Santiago
7dd997d442 Minor tweaks around image alignment in ASButtonNode (#2271) 2016-09-20 19:47:13 -04:00
Rocir Santiago
5990376f68 Add support to image alignment in ASButtonNode (#2266) 2016-09-19 17:16:49 -07:00
Michael Schneider
8897614f0e [Layout] Layout API based on content area (#2110)
* Initial commit for adding a size constraint to ASLayoutable's

* Some more commits

* Fix sample projects in extra/

* Remove preferredFrameSize test of ASEditableTextNode

* Remove preferredFrameSize from examples_extra

* Add deprecation warning to -[ASDisplayNode preferredFrameSize]

* Add deprecation warning to -[ASDisplayNode measureWithSizeRange:]

* Commit

* Commit

* Remove ASRelativeSizeRange

* Make ASRelativeSize private

* Adjust examples

* Improve setting of -[ASLayoutable size] with points or fractions

* Add ASWrapperLayoutSpec

* Improve creation of ASRelativeDimension

* Add `preferredFrameSize` back and add deprecated logging

* Add `layoutSpecBlock` setter and getter and add locking for it

* Add better documentation and fix macros to create ASRelativeDimension

* Create new ASSizeRangeMake with just a CGSize as parameter

* Update Kitten and Social App Layout example

* Add layoutThatFits: and deprecate measure:

* Rename ASRelativeDimension to ASDimension

* Fix examples for ASDimension renaming

* Remove fancy height and width setter

* Fix ASDimension helper

* Rename -[ASLayout layoutableObject] to -[ASLayout layoutable]

* Update layout related methods and more clearer documentation around how to use it

* Deprecate old ASLayout class constructors

* Don't unnecessary recalculate layout if constrained or parent size did not change

* Use shared pointer for ASDisplayNodeLayout

* Fix rebase conflicts

* Add documentation and move implementation in mm file of ASDisplayNodeLayout

* Fix test errors

* Rename ASSize to ASLayoutableSize

* Address comments

* Rename setSizeFromCGSize to setSizeWithCGSize

* Improve inline functions in ASDimension

* Fix rebase conflicts
2016-09-07 08:44:48 -07:00
Adlai Holler
5e3627a9cd [ASTextNode] Actually deprecate attributedString property (#2151) 2016-09-01 16:43:03 -07:00
Michael Schneider
11215bf97f [Automatic Hierarchy Management] Rename IHM to automatic hierarchy management and move out of beta header (#2066)
* Rename automaticHierarchy to automaticallyManagesSubnodes

* Comment adjustments
2016-08-15 12:06:06 -07:00
appleguy
74bf376b2f [ASDisplayNode] Rename _propertyLock to __instanceLock__ to avoid subclass naming collisions. (#1941) 2016-07-16 15:32:13 -07:00
Huy Nguyen
4b331be1e8 Correctly compare and update title of ASButtonNode 2016-07-12 21:25:22 +07:00
Michael Schneider
53f22da1dc Code style improvements 2016-06-30 07:30:57 -07:00
Michael Schneider
d1b4e07d0f Add support for 'preferredFrameSize' to ASButtonNode 2016-06-30 07:30:57 -07:00
Hannah Troisi
c857e809f4 Clean up header comments (for consistent Facebook licensing info) (#1741)
[Licensing] Clean up header comments (for consistent Facebook licensing info)
2016-06-11 23:31:39 -07:00
Aaron Schubert
06d4573b14 [tvOS] Branch out tvOS specific code into it's own categories 2016-04-21 08:59:14 +01:00
Aaron Schubert
21abe8f899 Fix merge conflicts 2016-04-19 09:02:07 +01:00
Eric Jensen
12da9ac6a9 Improve Swift compatibility of ASHorizontalAlignment & ASVerticalAlignment by using consistent naming 2016-03-21 11:16:28 -07:00
Rahul Malik
4eb3356615 Basic a11y support for ASButtonNode 2016-03-20 19:22:53 -07:00
Eric Jensen
17aebcbaba Add a space between the ? and : in ternarys 2016-03-17 10:38:51 -07:00
Eric Jensen
33fda7ab49 - Use modern Objective-C syntax.
-  Simplify comparisons.
-  Remove dead stores.
2016-03-15 22:34:29 -07:00
Tom King
a22278340f fixed indentation 2016-03-09 10:27:38 -05:00
Tom King
cd85389397 support the combined [.Selected, .Highlighted] state in ASButtonNode 2016-03-09 09:23:15 -05:00
Aaron Schubert
f9bf402047 [tvOS] Clean up and document parts of code. 2016-02-25 09:06:11 +00:00
Garrett Moon
6a1298440d Flex shrink should be set on title init, not image init 2016-02-24 15:10:18 -08:00
Aaron Schubert
106b5f5d4a Update 2016-02-23 10:20:06 +00:00
Scott Goodson
cd6ca2885e [ASButtonNode] lazily initialize label, image, and backgroundImage (skip if never needed). 2016-02-20 13:00:01 -08:00
Aaron Schubert
f39ee46b61 Gate ASButtonNode setTitle method since [UIFont buttonFontSize] is unavailable on tvOS 9.1 2016-02-05 14:23:01 +00:00
Garrett Moon
64f36d4499 Add support for contentInset and make ASButtonNode a bit more threadsafe 2016-02-04 17:40:16 -08:00
appleguy
ea6c7ae938 Merge pull request #1025 from 1nput0utput/ASButtonNodeImprovements
[ASButtonNode] Add support for backgroundImage.  Extend & simplify API with separate title and color.
2016-01-23 12:45:48 -08:00
Rajinder Ramgarhia
389945d69d ASButtonNode sets its subnodes as layer backed, but itelf should not be layer backed 2016-01-20 14:29:34 -05:00
Rajinder Ramgarhia
6c56a6046b Simpler ASButtonNode API to set title and set background image 2016-01-16 00:23:03 -05:00
Scott Goodson
affb786a14 [ASButtonNode] Pass through setDisplaysAsynchronously: to subnodes (image and title). 2016-01-14 23:12:01 -08:00
Bin Liu
a36a955eb0 fix indentation 2016-01-06 13:09:59 -08:00
Bin Liu
4435405cbb Make ASControlState imitate UIControlState
- selected state isn't implicitly controlled by ASControlNode anymore
- highlighted state can be overriden by users
- Decouple ASButtonNode's state from control events
2016-01-06 12:17:52 -08:00
Bin Liu
4f67050b9b Fix another typo, fix build failure 2016-01-05 18:04:26 -08:00
Bin Liu
6bb51063f9 Replace ASButtonState with ASControlState 2016-01-05 17:07:44 -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
Rajinder Ramgarhia
108ce6d8fc Set horizontal & vertical alignment default to center. Use ivar to set layout. 2015-12-22 14:23:21 -05:00
Rajinder Ramgarhia
d7b128e19b ASButtonNode content alignement properties 2015-12-22 14:23:21 -05:00
Scott Goodson
3416450f11 Adding ASButtonNode. Simple but flexible, add features as desired! 2015-10-31 15:12:05 -07:00