329 Commits

Author SHA1 Message Date
Erekle
4f40f3c12f Merge remote-tracking branch 'facebook/master' into ASVideoPlayerNode
# Conflicts:
#	AsyncDisplayKit.xcodeproj/project.pbxproj
2016-05-26 12:15:23 +04:00
Levi McCallum
95f1ab4902 [ASDisplayNode] Rename ASDisplayNodeTransitionContext to ASLayoutTransition (#1680)
* [ASDisplayNode] Rename ASDisplayNodeTransitionContext to ASLayoutTransition

* Rename internal ivar to fit new naming

* Fix tabbing
2016-05-25 10:10:27 +07:00
Erekle
8c8fc3dba0 Adding ASVideoPlayerNode 2016-05-17 11:08:53 -07:00
rcancro
4b54144f55 Levi's comments 2016-05-11 10:21:11 -07:00
rcancro
9d622c7eac changed DisplayTraits to TraitCollection 2016-05-10 14:45:03 -07:00
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
d1054d6ed9 Move from ASSentinel to a atomic int 2016-05-05 20:25:07 -07:00
Michael Schneider
dc6d2e7660 Improve Transition ID handling 2016-05-05 20:25:07 -07:00
Garrett Moon
938ecd9b6f Fix deadlock when laying out on multiple threads
Summary:
We observed a deadlock which occurred when two threads were laying out the same set of nodes.

On one thread, layout would occur on a leaf node. It would lock and as part of this layout
process, ASDK walks up the node tree and calls __setNeedsLayout on its supernode until it
reaches the supernode with no supernode. When the supernode gets its call to __setNeedsLayout
it also locks. So leaf node locks and then awaits supernode lock.

On another thread, we're doing a layout pass on the supernode in the above thread. This locks
the supernode and attempts to lock the leaf node. This deadlocks (remember the above thread
is holding onto the leaf lock and awaiting the supernode lock. This thread is holding onto
the supernode lock and awaiting the leaf lock).

This is all exacerbated by the use of recursive locks.
2016-05-03 15:56:38 -07:00
appleguy
dd4853bf3a Merge pull request #1273 from aaronschubert0/tvOS
[tvOS] Add default focus states to ASControlNode & ASImageNode.
2016-04-20 13:29:31 -07:00
appleguy
b8379a07a6 Merge pull request #1563 from maicki/FollowupFixASCollectionNodeASTableNodeBackgroundColor
Follow up for ASCollectionNode and ASTableNode background color fix
2016-04-19 18:11:28 -07:00
Michael Schneider
42174210c5 Follow up for ASCollectionNode and ASTableNode background color fix 2016-04-19 16:07:42 -07:00
Garrett Moon
0fc39d1ccd Follow up to animated GIF PR 2016-04-19 13:43:41 -07:00
appleguy
39da0987a3 Merge pull request #1537 from maicki/FixASCollectionNodeASTableNodeBackgroundColor
Fix ASTableNode / ASCollectionNode backgroundColor does not apply correctly.
2016-04-19 12:30:54 -07:00
Michael Schneider
3793dc024e Improve setting special properties for certain classes directly to the UIView
- Remove duplicated code in ASCollectionNode and ASTableNode
- Fix setting the pending state to the view if applying the pending state to the view
2016-04-19 10:50:22 -07:00
Vivian Qu
ccb5860c78 Update ASSentinel to use OSAtomicAdd32 to support iOS7.0 2016-04-19 10:46:55 -07:00
Aaron Schubert
21abe8f899 Fix merge conflicts 2016-04-19 09:02:07 +01:00
Michael Schneider
9d07336c75 Fix static analyzer issue with common indexes algorithm in _asdk_commonIndexesWithArray:
The issue was: The left operand of '>=' is a garbage value in else if check for lengths[i+1][j] ... I had to rewrite the algorithm to quiet the static analyzer.
2016-04-18 14:38:32 -07:00
appleguy
30a0c471ca Merge pull request #1528 from ejensen/instancetype
[Refactoring] Replace id with instancetype in initializers
2016-04-16 20:53:41 -07:00
Huy Nguyen
3dc2ceb0ad Remove ASDisplayNodeExtraIvars 2016-04-15 21:48:11 +03:00
Garrett Moon
24c26014a7 Fix example builds 2016-04-13 14:23:02 -07:00
Eric Jensen
527397ba7e Replace id with instancetype in initializers 2016-04-13 11:20:05 -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
appleguy
74407d50c4 Merge pull request #1513 from maicki/NodesLayerInLayerAccessiblity
[ASDisplayNode] Add handling layer backed accessibility elements within layer backed nodes
2016-04-11 17:46:19 -07:00
Michael Schneider
45d50624d1 Fix disabled state propagation for final layoutable 2016-04-11 17:41:48 -07:00
Michael Schneider
2fade63f1b Add handling layer backed accessibility elements within layer backed nodes 2016-04-11 12:59:04 -07:00
Michael Schneider
ed0ed74b72 Add switch to enable / disable layout option properties 2016-04-10 15:04:49 -07:00
Scott Goodson
974d8c8817 [ASEnvironmentState] Don't upward-propagate sizeRange or layoutPosition (this behavior, if ultimately desirable, requires additional limiting conditions). 2016-04-10 01:31:32 -07:00
appleguy
7c4db3fbc1 Merge pull request #1477 from maicki/SmallContentBatchFetch
[ASBatchContext] Fix fetch call won't occur for content smaller than bounds unless user scrolls
2016-04-09 19:15:06 -07:00
Michael Schneider
28c4fede57 Add support for newly added a11y properties in iOS 8 / 9 and tvOS
New a11y properties:
- accessibilityNavigationStyle
- accessibilityHeaderElements
- accessibilityActivationPoint
- accessibilityPath
2016-04-09 11:23:25 -07:00
Michael Schneider
f3303c1fb8 Add properties for accessibilty to ASDisplayNode to support layer backed nodes 2016-04-09 11:23:25 -07:00
Michael Schneider
9c29d0efa8 Initial commit for improved accessibility support 2016-04-09 11:23:25 -07:00
Michael Schneider
be26f0c2e5 Revert back to use UIKit version to prevent animations 2016-04-09 10:55:52 -07:00
Michael Schneider
bb110ca6e8 Readd ASDisplayShouldFetchBatchForContext 2016-04-09 10:55:52 -07:00
Michael Schneider
24ca09ee6c Move most of the batch fetching logic to a central place for ASTableView and ASCollectionView usage 2016-04-09 10:55:52 -07:00
Michael Schneider
c25a252e1c Fix fetch call won't occur for content smaller than bounds unless user scrolls 2016-04-09 10:55:52 -07:00
Levi McCallum
6f41d28dd0 Fix issue where zero was returned on idential object array lookup
Reviewers: scottg, schneider, garrett

Reviewed By: garrett

Subscribers: jenkins

Differential Revision: https://phabricator.pinadmin.com/D84131
2016-04-08 16:35:40 -07:00
Levi McCallum
2cb6969c79 Use unsigned integers for findNodes vectors
Summary: Also refector logic and naming to be simpler and more descriptive

Reviewers: schneider, chris, scottg

Reviewed By: schneider, chris, scottg

Subscribers: chris, jenkins

Differential Revision: https://phabricator.pinadmin.com/D83911
2016-04-08 10:41:49 -07:00
Michael Schneider
27cc2bec82 Add merging ASEnvironmentStateExtensions on upward propegation 2016-04-05 14:22:32 -07:00
Michael Schneider
41eb1917e4 Fix setting ASEnvironmentStateExtensions values 2016-04-05 14:22:32 -07:00
Hannah Troisi
dbad1c38e5 [ASEnvironment - Layout] Fixes to upward propagation of ASLayoutable properties. 2016-04-02 15:03:43 -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
Eric Jensen
12da9ac6a9 Improve Swift compatibility of ASHorizontalAlignment & ASVerticalAlignment by using consistent naming 2016-03-21 11:16:28 -07:00
Scott Goodson
8308a4ce49 [AsyncDisplayKit] Adopt #pragma once, remove last remaining dispatch_sync (UIScreen scale). 2016-03-19 19:56:41 -07:00
Eric Jensen
17aebcbaba Add a space between the ? and : in ternarys 2016-03-17 10:38:51 -07:00
appleguy
d9ef0922d8 Merge pull request #1354 from ejensen/cleanup
[Refactoring] Objective-C 2.0 / Modern syntax for arrays, dictionaries, numbers; logic simplification
2016-03-17 01:06:33 -07:00
appleguy
2ad9d83520 Merge pull request #1353 from ejensen/spelling
[Documentation] Correct spelling errors
2016-03-16 22:53:15 -07:00