584 Commits

Author SHA1 Message Date
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
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
rcancro
4b54144f55 Levi's comments 2016-05-11 10:21:11 -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
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
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
Adlai Holler
f9cd9730f7 Add nullability to ASPINRemoteImageDownloader.h 2016-05-07 15:55:00 -07:00
Adlai Holler
2e2ebe8c08 [ASPINRemoteImageDownloader] Replace instancetype with actual class name for shared instance 2016-05-07 15:53:28 -07:00
Adlai Holler
33d0919b1f [ASImageProtocols] Be smarter about nullability with image downloader protocol 2016-05-07 15:50:03 -07:00
Adlai Holler
68e324d2d0 Improve commentary 2016-05-07 15:18:11 -07:00
Adlai Holler
fab117b824 [ASPINRemoteImageDownloader] Call download progress handler 2016-05-07 15:14:30 -07:00
Michael Schneider
bc8489528e Fix crash in delegate / dataSource proxies for ASCollectionView and ASTableView 2016-05-04 21:03:43 -07:00
Michael Schneider
298b9a2be7 Fix ASPagerNode data source and delegate inconsistencies
- Change ASPagerNodeDataSource -> ASPagerDataSource
- Add ASPagerDelegate
2016-05-04 21:03:13 -07:00
Wendy
0b55df9649 Add the ability for ASNetworkImageNodes to keep track of their progressive image quality 2016-04-26 18:33:59 -07:00
Michael Schneider
2ab82f5995 Move to fast enumeration for iterating through an array
We move from block based enumeration for the array to fast enumeration as from a benchmark perspective this is faster. For the dictionary we stay with block based enumeration as looking up the value for the key in e.g. fast enumeration would be slower as using the block based API where we get the key and value for passed in
2016-04-26 10:45:35 -07:00
appleguy
74b866e6ba Merge pull request #1559 from garrettmoon/upstream-GIF-Cleanup
[ASImageNode] Follow up to animated GIF PR
2016-04-19 16:43:49 -07:00
Michael Schneider
68de6a6391 Fix "[NSProxy methodSignatureForSelector:] called!" crash 2016-04-19 15:06:00 -07:00
Garrett Moon
0fc39d1ccd Follow up to animated GIF PR 2016-04-19 13:43:41 -07:00
appleguy
322d85e738 Merge pull request #1511 from maicki/ASLayoutSpecOptimizations
[ASLayoutSpec] Improvements for ASLayoutSpec's internal implementation of child / children properties.
2016-04-17 20:26:54 -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
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
Garrett Moon
755c5feaf8 Levi's comments 2016-04-13 14:23:02 -07:00
Garrett Moon
24c26014a7 Fix example builds 2016-04-13 14:23:02 -07:00
Garrett Moon
e9b57d9da4 Address comments and cleanup 2016-04-13 14:23:02 -07:00
Garrett Moon
1b316217ef Downstream ASAnimatedImage 2016-04-13 14:23:02 -07:00
Garrett Moon
3bcbfb149d Add support for animated GIFs
Summary:
Use NSData as key

Add chunking of files

Add support for Animated Images

This adds support for GIF playback in ASDK. It's not currently ready
for merging to public ASDK – for one the GIF decompression may make
more sense in PINRemoteImage.

Removed duration as it wasn't used

Make cover image lazily loaded

Differential Revision: https://phabricator.pinadmin.com/D82033
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
Michael Schneider
2fade63f1b Add handling layer backed accessibility elements within layer backed nodes 2016-04-11 12:59:04 -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
6a147021bc Move setting of accessibilityFrame into accessibleElements
- Calculate accessibilityFrame for accessibleElements already in accessibleElements method
- Remove asyncdisplaykit_node associated object as it's not needed anymore
2016-04-09 17:03:35 -07:00
Michael Schneider
1b7db082dd Improve _ASDisplayViewAccessibility
- Add class method to create a UIAccessibilityElement from a ASDisplayNode
- Add function to iterate through a ASDisplayNode tree in bfs fashion
- Add assert for _accessibleElements in accessibilityElementAtIndex:
2016-04-09 16:07:30 -07:00
Michael Schneider
14ca529911 Moving accessibility related code to _ASDisplayViewAccessibility 2016-04-09 11:23:25 -07:00
Michael Schneider
3b91c22fdf Recreate the accessibleElements if accessed 2016-04-09 11:23:25 -07:00
Michael Schneider
34df512eeb Remove ASNodeValidForAccessibility 2016-04-09 11:23:25 -07:00
Michael Schneider
ef31c3abf0 Copy accessibilityIdentifier to UIAccessibilityElement if a node is assigned 2016-04-09 11:23:25 -07:00
Michael Schneider
4056bf9ef3 Return NO if node i not valid for accessibility 2016-04-09 11:23:25 -07:00
Michael Schneider
03a7c55d59 Add accessibility support for shouldRasterizeDescendants and layerBacked nodese 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
18fe728230 Remove deprecation of completeBatchFetching: 2016-04-09 10:55:52 -07:00
Michael Schneider
f92e7d5a29 Move completeBatchFetching: to deprecated location in header 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
Scott Goodson
a9b02e8632 [ASDataController] Handle incorrect client code that returns a nil ASCellNode (assert, but use zero-size cell in production). 2016-04-06 21:34:06 -07:00