4229 Commits

Author SHA1 Message Date
Marvin Nazari
3506cec1c0 [ASVideoPlayerNode] Added an optional full screen button (#2688)
* full screen button for ASVideoPlayerNode

* fixed a small issue when disabling controlsDisabled is set

* styling fixed

* make videoNode public on ASVidePlayerNode

* [ASVideoPlayerNode] fixed an issue when re-enabling the controls the duration time label didn't updated correctly

* [ASVideoPlayerNode] Check if CMTime is valid before setting the labels
2016-12-21 13:09:57 -05:00
Garrett Moon
69e6f4e387 This should mirror the output you get from installing via Carthage. (#2801) 2016-12-21 13:05:48 -05:00
Huy Nguyen
f52275b9ba Annotate the code that records mutex owner and level of ownership in ASThread (#2809)
* Annotate the code that records mutex owner and level of ownership in ASThread

* Fix typo in ASThread
2016-12-21 12:49:55 -05:00
Garrett Moon
bec299fa87 Update to 2.0.1 2016-12-20 14:57:38 -08:00
Garrett Moon
4ae2948d53 These messages must be called on main. (#2814) 2016-12-20 14:29:32 -08:00
Huy Nguyen
9357f54344 Support visibility events in ASScrollNode (#2799)
* Support visibility events in ASScrollNode

* Sort imports in ASScrollNode.mm
2016-12-20 10:26:01 -08:00
Adlai Holler
3e53d26686 Ensure that all nodes are deallocated inside the thrash testing method to avoid polluting other tests (#2800) 2016-12-19 18:45:57 -05:00
David Robles
498e5a9403 Assert when attempting to set a nil background / overlay layout element. (#2796) 2016-12-19 17:41:45 -05:00
Adlai Holler
eea5ddac3e Range Controller Explicitly Marks Disappeared Nodes as Invisible (#2805)
* Improve visibility handling for range-managed nodes

* Tweak ASWeakSet & the test

* Put back a few things that are pending a different diff

* Add a test

* Ensure we update visible nodes, even if there are no new ones
2016-12-19 17:38:27 -05:00
haritowa
64ee8dbffb [ASDisplayNode Deallocation] Fix for crash when certain types are used as instance variables. (#2803)
* Fix https://github.com/facebook/AsyncDisplayKit/issues/2802

* Change nil to NULL
2016-12-19 17:06:23 -05:00
Huy Nguyen
f7a0ac9760 [ASThread][ASDisplayNode] Detect and avoid deadlocks caused by upward lock gathering in didEnter/Exit states (#2764)
* Implement mutex ownership and use it to check potential upward lock gathering

* Don't hold instance lock and call willEnterHierarchy/didExitHierarchy of ASDisplayNode
- This can cause deadlocks (e.g #2605) if subsequent methods, that are implemented by developers, walk up the node tree.
- This is a way to keep the optimizations introduced in 9e87813 while making sure the locking situation is a bit safer.

* More lock ownership assertions in ASDisplayNode

* Document main thread contract  of -clearContents

* ASNetworkImageNode shoud not call setNeedsPreload while holding instance lock
- This helps to avoid potentially deadlocks caused if the node (esp in case it's a subclass of ASNetworkImageNode) walks up the tree in didEnterPreloadState, for example to build logging context.

* ASVideoNode should not call setNeedsPreload while holding instance lock
- This helps to avoid potentially deadlocks caused if the node (esp. if it's a subclass of ASVideoNode) walks up the tree in didEnterPreloadState, for example to build logging context.

* Don't hold instance lock for the entire insert subnode operation
- The recursive lock should not be held throughout `_insertSubnode:atSubnodeIndex:sublayerIndex:andRemoveSubnode:`. The method instead should manage the lock itself and acquire it as shortly as possible. The reason is that this method calls many methods outside the scope of `self`. `[subnode __setSupernode:self]` is especially troublesome because it causes the subnode to migrate to new hierarchy and interface states, which triggers `didEnter/Exit(.*)State` methods. These methods are meant to be overriden by subclasses. Thus they might walk up the node tree and potentially cause deadlocks, or they perform expensive tasks and cause the lock to be held for too long.
- Other methods that call this method should release the lock before doing so.

* Lock getter and setter of `synchronous` flag

* Address comment in ASVideoNode

* Add main thread assertions to methods that change asset and assetURL of ASVideoNode

* Explain CHECK_LOCKING_SAFETY flag

* More thread and locking assertions in ASVideNode
- It's not safe to call `-[subnode __setSupernode:self]` while holding instance lock of soon-to-be supernode (e.g `self`).
- It's also not safe to call `[subnode __setSupernode:nil]` while holding the instance lock of the old supernode (e.g `self`).
- did(Enter|Exit)(.*)State methods are always called on main. Add main thread assertions to indicate that.

* Minor change in explanation of CHECK_LOCKING_SAFETY flag
2016-12-19 12:11:26 -08:00
Huy Nguyen
546925b6d6 Lock and unlock __instanceLock__ directly for a Minor perf win in ASImageNode (#2797)
- Suggested by @appleguy in #2778
2016-12-19 12:10:40 -08:00
Huy Nguyen
c0ae709b88 [ASDisplayNode][ASImageNode] Small refactorings (#2778)
* Comment out template code and fix another comment in ASDisplayNode

* Release instance lock a bit sooner and fix indentation in ASImageNode
2016-12-18 20:57:35 -08:00
Hannah Troisi
a59a0f0a31 don't allow nil background / overlay layout elements (#2795) 2016-12-18 12:25:57 -08:00
David Hart
3b2e53fbe9 Fixed Carthage build error (#2761) 2016-12-18 00:38:29 -08:00
Garrett Moon
b1094303b5 Need to forward protocol support too. (#2784) 2016-12-18 00:36:05 -08:00
Garrett Moon
e95a1ca040 Any shared schemes will be build by carthage, this project shouldn't be built by carthage. (#2792) 2016-12-16 16:16:52 -08:00
Garrett Moon
6399a44444 Had the conditional in ASNetworkImageNode wrong (#2781) 2016-12-15 12:51:00 -08:00
Garrett Moon
dabb69d461 Don't behave like an image node if URL is set. (#2774)
After much discussion I think this is the correct behavior. It seems
like it's much more likely to be the expected behavior but still enables
you to use the network image node like an regular image node.
2016-12-15 12:01:18 -08:00
Adlai Holler
e9a3d3fd03 Remove a bunch cruft around removed methods (#2765) 2016-12-14 11:02:18 -08:00
Andrey Konstantinov
3cb1112440 [ASDisplayNode] Add nullability declarations in ASDisplayNodeInternal.h (#2721)
* Add nullability declarations in ASDisplayNodeInternal.h

Fixes #2701

* Use NS_ASSUME_NONNULL macros in ASDisplayNodeInternal.h

It reduce visual clutter and keep file in line with most other header
files.
2016-12-14 12:39:34 -05:00
Scott Goodson
6db83732a8 [Examples] ASDKgram: Improve style and formatting of primary LayoutSpec implementation.
This edits only the flat layout style.  The visually structured version is still the default.
2016-12-13 13:50:06 -08:00
Adlai Holler
f637392a77 [ASTextNode] Ensure that isTruncated computes the correct value when sizing fast-path is used. (#2550) (#2763)
* Fix fast-path isTruncated.

* Clean up formatting; remove extra char.
2016-12-13 14:01:50 -05:00
ricky
8920b60dcd [ASDisplayNode] Remove node from supernode before adding it as a subview (#2746)
* [ASDisplayNode] Remove node from supernode before adding it as a subview

If a node is being added as a subview to a UIVIew, we must make sure to remove it as a subnode of its supernode.

* remove from supernode if adding to a layer.
2016-12-13 09:34:05 -08:00
Scott Goodson
ab5627b9e3 [Build] Fix up ASScrollNode to import the new FrameworkSubclasses.h file. 2016-12-12 19:49:00 -08:00
Michael Schneider
ddc23af8e7 [Layout Transition] Reset the alpha value for inserted and removed subnode to initial value (#2729)
* Reset the alpha value for removed subnodes in layout transition to 1 after removal

* Some improvements

* Restore alpha value of inserted and removed subnodes to original alpha value in animated layout transition
2016-12-12 19:46:01 -08:00
jaichaudhry
03045ee549 [PhotoCellNode]Update formatting of layoutSpec to a flat structure. (#2732)
* [PhotoCellNode]Update formatting of layoutSpec to a flat structure.

* [PhotoCellNode] Adding a flag to switch between flat and tree like structure of layout specs.
2016-12-12 19:45:33 -08:00
appleguy
eeb977e145 [ASDisplayNode] Ensure all subclasses are using base class __instanceLock__ and not re-defining their own. (#2754)
* [ASDisplayNode] Ensure all subclasses are using base class __instanceLock__ and not re-defining their own.

This also moves the @package definition of the instance variable to +FrameworkPrivate instead of Internal.h,
because Internal.h should ideally not be used outside of the ASDisplayNode file setup.  This has greatly reduced
the number of imports of Internal.h.

* [ASDisplayNode] Add ASDisplayNode+FrameworkSubclasses.h to share __instanceLock__ definition.
2016-12-12 19:42:41 -08:00
Michael Schneider
ad37ecfa74 Some smaller SocialAppLayout example improvements (#2743) 2016-12-12 16:12:26 -08:00
Michael Schneider
57cd6a3ba8 [ASPagerNode] Fix content insets are wrong in pager node if root node of ASViewController and transition back (#2736)
* Fix content insets are wrong in pager node if root node of ASViewController and transition back

* Add unit test

* Improve test

* Fix test

* Move tests to ASPagerNodeTests
2016-12-12 16:05:09 -08:00
appleguy
d874eed78a [ASScrollNode] Refine edge case of new automaticallyManagesContentSize logic to adopt stack's size in unconstrained dimensions. (#2759) 2016-12-12 15:56:15 -08:00
appleguy
2feabd2832 [ASScrollNode] Support for automaticallyManagesContentSize, adopting the ASLayoutSpec's size as the scrollable contentSize. (#2753)
* [ASScrollNode] Support for automaticallyManagesContentSize, adopting the ASLayoutSpec's size as the scrollable contentSize.

This feature has been desired for a long time, and has turned out to be phenomenally useful and easy to use.

It works well either for a blank ASScrollNode with .layoutSpecBlock set on it, or a subclass of ASScrollNode with a more
traditional layoutSpecThatFits: implementation.  With this approach there is no need to capture the layout size, use
an Absolute layout spec as a wrapper, or set contentSize anywhere in the code and it will update as the layout changes!

There is no automatic management of contentInset, but it would make sense to add this with keyboard listeners in the future.

* [ASScrollNode] Add locking to new properties, adjust how calculateLayout override is done.
2016-12-12 12:03:54 -08:00
appleguy
92affcee64 [ASControlNode] Add ASControlNodeEventValueChanged to support creating switches, sliders, etc. (#2751) 2016-12-12 10:42:42 -08:00
Garrett Moon
b8be6076a8 Remove build status for now since we're using Jenkins and we can't publicise results because of network restrictions. (#2745) 2016-12-09 14:02:56 -08:00
Hannah Trosi
a64253cf38 [Examples] move failing Shop example to extra folder until config is fixed 2016-12-09 13:52:25 -08:00
Garrett Moon
2e1d6c122e Update to 2.0 (#2735) 2016-12-08 15:35:55 -08:00
StrauneanuDimitri
3d1ff675c5 [Examples] Added Bear Shop project (#2614)
* [Examples] Added Bear Shop project

* - added screenshots
2016-12-08 09:57:07 -08:00
Adlai Holler
5b80a641af Improve Handling of Rasterized Node Interface & Hierarchy States (#2731)
* Improve handling of rasterize node interface states and testing

* Fix harder

* Finish fixes and move rasterization flag into beta header

* Re-enable rasterization in ASDKgram

* Re-enable working test

* Only do it in debug
2016-12-08 09:52:21 -08:00
Huy Nguyen
016d99f420 Document default values of alignItems and justifyContent (#2733) 2016-12-08 07:53:05 -08:00
Michael Schneider
4355f4d2ee [Layout] Don't crash if layout elements are created in layoutSpecThatFits: (#2694)
* Fix crash if layout elements are created with no owner and referenced in layoutSpecThatFits:

* Add failing test for nodes deallocated while creating in layoutSpecThatFits:

* Some more

* Some cleanup

* Added more complexity to tests

* Only cache sublayouts if the layout get’s flattened

* Address comments

* Address comments
2016-12-07 14:58:34 -08:00
Garrett Moon
80ab695cd0 Add lint mode to build.sh (#2728) 2016-12-07 14:38:12 -08:00
Adlai Holler
7de2decdcb Allow section-indexpaths in collection & table validation (#2727) 2016-12-07 13:36:15 -08:00
Michael Schneider
a6b2166244 Don’t compare the hash instead compare the attributes in ASTextNodeRendererKey isEqual (#2726) 2016-12-07 09:57:48 -08:00
Michael Schneider
beb98b448e [ASTextKit] Remove internal side effects related to constrainedSize. 2016-12-06 19:53:58 -08:00
Michael Schneider
c3cbd3b583 Just call super to change the size of the cell node that will resize itself instead of setting the frame directly (#2725) 2016-12-06 15:53:09 -08:00
Adlai Holler
5b8330107f Merge pull request #2708 from maicki/MSPreventSettingImageSpecificImageNodeSubclasses
[ASImageNode] Add handling of setting .image in specific ASImageNode subclasses
2016-12-06 15:23:13 -08:00
Garrett Moon
54eba883d8 Update to RC 2 (#2723) 2016-12-06 15:11:00 -08:00
Michael Schneider
ee0cc9b103 Further logic and documentation improvements 2016-12-06 14:19:54 -08:00
Michael Schneider
aec8dbfb33 Fix ASDKGram deprecation warning (#2719) 2016-12-06 11:52:31 -08:00
Garrett Moon
d57760797a Update to beta 7 of PINRemoteImage - fixes image corruption issues. (#2720) 2016-12-06 11:11:00 -08:00