1926 Commits

Author SHA1 Message Date
ricky
c42b0dd33a Remove explicit passing of trait collection to setChild/Children 2016-05-25 10:49:42 -07:00
ricky
a33966d4ae Actually propagate the traits down on layout spec 2016-05-24 11:15:41 -07:00
ricky
59a26ee111 [ASTraitCollection] Bug fixing/LayoutSpec propagation
* Fixed bug in `ASEnvironmentMergeObjectAndState`
* New ASLayoutSpec methods for `setChild`/`setChildren`/`setChild:forIdentifier:` have been added to take in a trait collection.
* Added `setChild:`-like methods for ASLayoutSpecs take a traitCollection
* Fixed instances where nodes in a data controller were not getting their trait collections
* propagate traitCollection in ASDisplayNode on insertSubnode or addSubnode
2016-05-23 16:37:40 -07:00
Garrett Moon
94bb3b79cb May as well use the existing visibility function. (#1684) 2016-05-22 14:12:29 +08:00
Rocir Santiago
e8a49b57bc Change ASTableView's visibleNodes interface to return array of ASCellNodes (#1666) 2016-05-22 14:10:12 +08:00
Eric
4ac2d52a06 Allow nil borderColor when using ASImageNodeRoundBorderModificationBlock (#1686) 2016-05-21 11:12:40 +08:00
Eric Jensen
d3c33a38bb Add missing nullability annotations to headers related to display node transitions (#1688) 2016-05-21 11:10:07 +08:00
Max Gu
73b41ee450 Renaming the delegate flags for the deprecated methods 2016-05-18 22:10:06 -07:00
Max Gu
1c64a4a785 Surpressing deprecated methods warning 2016-05-18 16:39:45 -07:00
Max Gu
90877847c2 Adding deprecated methods back 2016-05-18 14:05:08 -07:00
Max Gu
a93bc72e25 Updating and adding a few APIs for ASVideoNode 2016-05-18 08:40:58 -07:00
Max Gu
772cf15b83 Merge branch 'master' into patch-3 2016-05-18 08:37:24 -07:00
Max Gu
325e37020c Adding startup loading state in ASVideoNode 2016-05-17 15:31:30 -07:00
Garrett Moon
8d4959bd76 Revert "ASViewController.m -> ASViewController.mm upstream"
This reverts commit b34e8d78de20ea11b2b07a24df3b12d2936d1a5e.

In attempting to rebase my visibility patch, I overwrote all of Ricky's
changes to ASViewController. This puts them back in.
2016-05-16 15:03:15 -07:00
appleguy
4cfe3f750a Merge pull request #1661 from maicki/MatchSubarrayContextsNodesCreation
[ASDataController] Match creation of subarrays for nodes and contexts in ASDataController
2016-05-13 23:47:41 -07:00
appleguy
50bdaa2442 Merge pull request #1658 from henish/ascollectionview_mutation_during_enumeration
[Sample] Resolve mutation during enumeration issue
2016-05-13 16:21:46 -07:00
Michael Schneider
eee2262262 Match creation of subarrays for nodes and contexts in ASDataController 2016-05-13 22:51:40 +02:00
Henish Shah
41a53887d7 [Sample] Resolve mutation during enumeration issue
- Mutating a dictionary using -enumerateKeysAndObjectsUsingBlock:
  can have unintended consequences.
- Using a copy of the keys to iterate over the values inside the
  dictionary instead.
2016-05-13 16:14:19 -04:00
Michael Schneider
33b76bbce0 Use calloc’d array for subarray of contexts 2016-05-13 21:38:25 +02:00
Michael Schneider
7d902d98c9 Fix passing wrong constrained size to nodes
In _layoutNodesFromContexts:ofKind:completion: we pass the full array of contexts to _layoutNodes:fromContexts:atIndexesOfRange:ofKind: but for nodes we pass a subarray of nodes instead based on the batchCount. As batchRange we always start from 0 to batchCount. We now use the same indexes that we use to create the subarray of nodes to get a subarray of contexts that we pass to _layoutNodes:fromContexts:atIndexesOfRange:ofKind:.
2016-05-13 21:06:16 +02:00
Henish Shah
8e38e225c8 [Sample] Resolve mutation during enumeration issue
- Mutating a dictionary using -enumerateKeysAndObjectsUsingBlock:
  can have unintended consequences.
- Using a copy of the keys to iterate over the values inside the
  dictionary instead.
2016-05-13 11:51:01 -04:00
appleguy
0bef0d09e7 Merge pull request #1653 from garrettmoon/visibility
[ASViewController] Add visibility depth management
2016-05-12 22:42:27 -07:00
Garrett Moon
72d7b57abb Don't add zero for readability 2016-05-12 14:44:54 -07:00
Garrett Moon
7901a985e3 Now that this is included by a C++ file, it needs the weird C extern thing. 2016-05-12 14:21:01 -07:00
Garrett Moon
4c78fb3846 Add setVisibilityDepth setter. 2016-05-12 13:42:05 -07:00
Garrett Moon
5a9ef8a6f7 Fix build 2016-05-12 13:42:05 -07:00
Garrett Moon
e296cad8ee Add support for visibility depth
Summary:
This adds support for the concept of visibility depth.

Visibility essentially defines the number of user actions it would
take a user to have a view controller visible. Knowing a view controllers
visibility depth allows view controllers to take action such as clearing
out memory that can be restored at a later date.

This patch also add two new view controller subclasses which adopt
the ASManagesChildVisibilityDepth protocol. Any view controller
that has child view controllers can adopt this protocol to indicate
to the child what they're visibility is. For example, ASNavigationController
will return a visibility depth of it's own visibilityDepth + 1 for
a view controller that would be revealed by tapping the back button.

Move common implementations to macros

Turn off visibility logging

Differential Revision: https://phabricator.pinadmin.com/D90395
2016-05-12 13:42:05 -07:00
Garrett Moon
b7b8ad54fd Move common implementations to macros 2016-05-12 13:42:05 -07:00
Garrett Moon
af7a2f09d7 Add support for visibility depth
This adds support for the concept of visibility depth.

Visibility essentially defines the number of user actions it would
take a user to have a view controller visible. Knowing a view controllers
visibility depth allows view controllers to take action such as clearing
out memory that can be restored at a later date.

This patch also add two new view controller subclasses which adopt
the ASManagesChildVisibilityDepth protocol. Any view controller
that has child view controllers can adopt this protocol to indicate
to the child what they're visibility is. For example, ASNavigationController
will return a visibility depth of it's own visibilityDepth + 1 for
a view controller that would be revealed by tapping the back button.
2016-05-12 13:42:05 -07:00
Garrett Moon
b34e8d78de ASViewController.m -> ASViewController.mm upstream 2016-05-12 13:40:32 -07:00
rcancro
8e444092be [ASEnvironment] Remove unneeded locking on environmentState 2016-05-12 13:13:30 -07:00
appleguy
efc81f5a1c Merge pull request #1592 from rcancro/displayTraits
[ASViewController] Add support for ASTraitCollection
2016-05-11 21:19:55 -07:00
rcancro
cfa9dcda56 typo and comment 2016-05-11 14:08:06 -07:00
Michael Schneider
9b3ecd28a9 Fix position of loading spinner in ASVideoNode 2016-05-11 20:14:22 +02:00
rcancro
4b54144f55 Levi's comments 2016-05-11 10:21:11 -07:00
appleguy
25feefeafb Merge pull request #1643 from levi/patch-14
[ASAsyncTransactionGroup] Create a new hash table on commit to prevent copy
2016-05-10 16:53:02 -07:00
rcancro
ffde31a1b2 Fixed a crash in ASTextNode that I made
fixes a crash introduced by https://github.com/facebook/AsyncDisplayKit/pull/1637
2016-05-10 15:25:34 -07:00
Levi McCallum
905f3a23b0 Create a new hash table on commit to prevent copy
Resolves #1342
2016-05-10 15:00:31 -07:00
rcancro
2995271346 add ASTraitCollection to umbrella header 2016-05-10 14:45:26 -07:00
rcancro
0806f529a3 change ASCOllectionNode back .mm file 2016-05-10 14:45:16 -07:00
rcancro
9d622c7eac changed DisplayTraits to TraitCollection 2016-05-10 14:45:03 -07:00
rcancro
a04cbb6e4f include displayContext in equality check 2016-05-10 14:44:48 -07:00
rcancro
f828d079fa added nsobject based ASDisplayTraits class 2016-05-10 14:44:43 -07:00
rcancro
35820e58a0 add locking to collection state propagation 2016-05-10 14:44:37 -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
appleguy
495f32f0ef Merge pull request #1570 from maicki/FixASTextNodeAttributedStringInconsitency
[ASTextNode] Fix API ASTextNode API inconsistencies
2016-05-10 13:44:56 -07:00
appleguy
a1d2f8ccc6 Merge pull request #1571 from maicki/FixASPagerNodeDataSourceSourceInconsistency
[ASPagerNode] Fix ASPagerNode data source and delegate inconsistencies
2016-05-10 13:44:39 -07:00
appleguy
d88e170163 Merge pull request #1624 from maicki/FixDelegateProxyCrash
[Accessibility / iOS 8] Fix 8.0 and 8.1-only, VoiceOver crash when clearing delegate / dataSource for Table or Collection
2016-05-10 13:43:40 -07:00
appleguy
db14ccf136 Merge pull request #1637 from rcancro/textShrinkFi
[ASTextNode] Fix to truncation when text font shrinking is engaged
2016-05-10 13:42:38 -07:00