239 Commits

Author SHA1 Message Date
Hannah Trosi
3080ee33cf Revert "update from master/"
This reverts commit d7fde61e168b6594ca5d74836597b0aac0e83e9b.
2016-07-02 11:45:40 -07:00
Hannah Trosi
d7fde61e16 update from master/ 2016-07-01 16:25:48 -07:00
Hannah Trosi
2e4b1ea053 [ASCellNode] Fix selection / highlight implementation 2016-06-25 00:22:28 -07:00
Adlai Holler
457e08005f [ASDataController] Remove asyncDataFetching Option, Cleanup (#1794)
* [ASDataController] Add some assertions to clarify what queues things happen on

* [ASCollectionDataController] Optimize willReloadData

* [ASDataController] Minor optimizations, no functional changes

* [ASDataController] Always reload data on _editingTransactionQueue

* [ASDataController] Remove async data fetching option, deprecate callbacks

* [ASDataController] Not mutable

* [ASMultidimensionalArrayUtils] Use fast enumeration

* Optimize ASMultidimensionalArrayUtils
2016-06-23 21:08:44 -07:00
Michael Schneider
f0bfa24fa3 Merge pull request #1766 from hannahmbanana/collectionLayout
[ASCollectionView, ASCellNode] Add support applyLayoutAttributes: on ASCellNode
2016-06-23 15:09:10 -07:00
Nick Velloff
a05d3119ad [WIP] Trigger new batch fetch for collection view after layout transitions (#1697)
[Table / Collection] Trigger new batch fetch after programmatic scrolls, or layout transitions.
2016-06-22 16:21:10 -07:00
Hannah Troisi
46421f8684 [ASCollectionView] support UICollectionViewLayoutAttributes 2016-06-17 10:17:52 -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
appleguy
4804f429b9 Revert "[ASCollectionView] Add a "Null Object" for a layout inspector if custom layout is given but no layout inspector" (#1713) 2016-06-04 22:49:10 -07:00
appleguy
87575b78ee [ASCellNode] Adding support for scroll view begin / end drag to VisibilityEvent changes. 2016-06-04 22:14:08 -07:00
Michael Schneider
00d9372ee4 Add a "Null Object" for a layout inspector if no no flow layout is given
The purpose of the ASCollectionViewCustomLayoutInspector is to provide a default implementation if given a custom layout, but no layout inspector.
2016-06-04 13:58:23 -07:00
Nick Velloff
d0c30a43ca expose relayoutAllNodes at ASCollectionView level (#1683)
* expose relayoutAllNodes at ASCollectionView level

* rename relayoutAllNodes to relayoutItems to be more UIKit centric
2016-05-24 13:22:01 +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
bc8489528e Fix crash in delegate / dataSource proxies for ASCollectionView and ASTableView 2016-05-04 21:03:43 -07:00
Michael Schneider
8f1beb8bf6 Addressed comments
- Use memset to clear flags
- Fix check for asyncDataSourceNodeForItemAtIndexPath
- Fix selector for asyncDelegateCollectionViewDidEndDisplayingNodeForItemAtIndexPath
- Fix multiple collectionViewWillEditCellsAtIndexPaths:batched: calls
2016-04-19 16:13:30 -07:00
Michael Schneider
d9f16e0acf Use _performingBatchUpdates for _layoutFacilitator batched parameter 2016-04-19 16:13:30 -07:00
Michael Schneider
3a20c6a1f4 Add caching for delegate and datasource calls in ASCollectionView and ASTableView 2016-04-19 16:13:30 -07:00
Michael Schneider
d0023a97f7 Fix fetching will continually trigger in a loop after reaching end of content
Don't schedule a new check for a batch fetch if no data changed previous batch fetch
2016-04-12 17:14:43 -07:00
Michael Schneider
3c66013088 Remove logging message 2016-04-10 14:23:33 -07:00
Michael Schneider
e9fe92444f Small comment fix 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
Scott Goodson
5b9302b681 Revert "Prevent deallocation of asyncDataSource and asyncDelegate in ASCollectionView and ASTableView"
This reverts commit 3668f45286a56a87d200aea0299caee9d2e4a880.
2016-03-22 14:38:50 -07:00
Michael Schneider
3668f45286 Prevent deallocation of asyncDataSource and asyncDelegate in ASCollectionView and ASTableView
Grab a strong reference for asyncDataSource and asyncDelegate in ASCollectionView and ASTableView before executing the range update to be sure they are not going away while executing the range update. This can happen in range updates while going back in the view controller hierarchy
2016-03-22 08:09:59 -07:00
Hannah Troisi
f9a92366d3 [AsyncDisplayKit] Fix build so we can weak link AVFoundation
Unclear why the framework target required these seemingly unrelated changes to Collection
classes, but I modeled them after related files and it seems cleaner now (passes tests & framework target)
2016-03-19 17:54:02 -07:00
appleguy
2ad9d83520 Merge pull request #1353 from ejensen/spelling
[Documentation] Correct spelling errors
2016-03-16 22:53:15 -07:00
Michael Schneider
e82118e72f Add assertion for ASDisplayNode is layer backed if using ASInterfaceStateForDisplayNode 2016-03-16 16:27:08 -07:00
Michael Schneider
8d771f930a Refactor calculation of interface state based on ASDisplayNode and window 2016-03-16 13:26:17 -07:00
Michael Schneider
3b4e8d732c Improve way to detect interface state of ASCollectionView and ASTableView 2016-03-16 11:45:22 -07:00
Michael Schneider
19232ac493 Address pull request comments 2016-03-16 11:44:56 -07:00
Michael Schneider
d3ba80ccfd Improvements for automatic range mode
- Only update range mode if visibility changes if the node is not range controlled
- Only change explicitly set range mode if ASRangeController becomes visible
- Return interface state for range controller in ASCollectionView and ASTableView based on if the containing node is range managed
2016-03-16 11:44:56 -07:00
appleguy
b30fa8b2f6 Merge pull request #1373 from maicki/FullRangeModeOnScroll
[ASRangeController] Go into full range mode if a scroll happens
2016-03-16 11:33:43 -07:00
Eric Jensen
ddd5ff1f75 Correct spelling errors 2016-03-15 21:56:51 -07:00
Huy Nguyen
22b105bfdc ASCollectionView doesn't animate size changes if some of the updated cell nodes don't want to 2016-03-15 16:17:43 -07:00
Michael Schneider
13aa891ecf Improve way to go into full mode on scroll 2016-03-12 17:45:09 -08:00
Michael Schneider
e4ddb7e270 Go into full range mode if a scroll happens 2016-03-12 15:44:27 -08:00
Gordon Chen
508ac44238 make sure ASCV's layoutFacilitator triggers layout recalculation when its subnode has size change 2016-03-11 16:49:33 -08:00
Scott Goodson
ff8ffffb7b [ASCellNode] Upgrades to ASCellNodeVisibilityEvent to ensure it is always synchronized with visibilityDidChange: 2016-03-10 20:21:00 -08:00
Scott Goodson
0e460ca00a [ASRangeController] Don't bother asking UIKit for the visible index paths if view is zero-sized, as it triggers a reloadData. 2016-03-10 19:10:25 -08:00
Scott Goodson
21bebb9d29 [ASRangeController] Improvements to application state change and memory warning handling.
Introduces ASLayoutRangeModeVisibleOnly, allowing the preservation of decoded backing stores without any extra padding to
strictly minimize memory usage while supporting immediate re-display of content.  Set visible range controllers to this mode
upon app suspend / memory warning, while more aggressively clearing others to the ASLayoutRangeModeLowMemory mode.

By default, when the app is running and recieves a memory warning, we set the range mode for non-visible controllers to
ASLayoutRangeModeVisibleOnly.  This is because, unlike in the app suspend case where on app resume we can restore controllers
from LowMemory to VisibleOnly, the memory warning doesn't provide a good opportunity to do this.

A new +Beta API to control this behavior is called +setRangeModeForMemoryWarnings:, as some apps may prefer to use LowMemory
in the memory warning scenario.  For these apps, optimal user experience will require manually setting the range mode back
to some larger value as the user navigates the app, or they will encounter controllers that are temporarily blank and need
a moment to re-display their contents as they start to become visible.
2016-03-09 21:22:45 -08:00
Ethan Nagel
352247184a Ensure that we use the correct default size for collection nodes even if layoutSubviews has not been called yet. This is a more conservative approach than the previous one. 2016-03-09 09:56:32 -08:00
Ethan Nagel
5a3dab5610 Ensure that er use the correct default size for collection nodes even if layoutSubviews has not been called yet 2016-03-08 17:03:55 -08:00
Scott Goodson
9c0d0542dd [ASScrollDirection] Fix scroll direction interpretation after recent changes to this logic. 2016-03-07 22:50:48 -08:00
appleguy
354ccf3e5f Merge pull request #1327 from samhsiung/fix_scrollable_directions
[ASCollectionView] scrollableDirections must account for alwaysBounce(Vertical | Horizontal)
2016-03-05 16:35:48 -08:00
Luke Zhao
03e84e20ac updated with deprecated message 2016-03-05 13:04:20 -08:00
Samuel Hsiung
85394f09b4 Account for alwaysBounce(Vertical|Horizontal) when calculating scrollable directions 2016-03-04 21:33:08 -08:00
appleguy
0a76c7b5d2 Merge pull request #1301 from lkzhao/collectionView-sectionInset-fix
Remove cell constrainedSize adjustment with section insets in constrainedSizeForNode
2016-03-04 14:26:55 -08:00
Luke Zhao
aa180c6f3b completely remove cell constrainedSize adjustment from section inset 2016-03-04 13:14:16 -08:00
Michael Schneider
aa2ae87c81 Add -waitUntilAllUpdatesAreCommitted to ASTableView and ASCollectionView
The API allows consumer of ASTableView or ASCollectionCiew to block execution of the main thread until all section and row updates are committed.
2016-03-02 19:38:14 -08:00
appleguy
e82d1408d2 Merge pull request #1292 from nguyenhuy/visibility_improvements
[ASCellNode] Update visibility API to support new event types for initial visibility & invisibility (caused by VC transitions, etc)
2016-03-02 19:30:31 -08:00