275 Commits

Author SHA1 Message Date
Adlai Holler
b21742c3c9 [ASCollectionView] Relayout Nodes as Soon as Bounds Changes (#2121)
* Add failing test case for ASCollectionView rotation

* [ASCollectionView] Relayout nodes immediately on bounds change
2016-08-23 14:33:45 -07:00
Adlai Holler
0bd664f9ed Remove numberOfSectionsForSupplementaryNodeOfKind: Method (#2102)
* Add unit test to confirm that supplementary items must be contained within actual sections

* [ASLayoutInspecting] Deprecate collectionView:numberOfSectionsForSupplementaryNodeOfKind:

* Add another test to dig deeper into UICollectionView
2016-08-19 11:18:31 -07:00
Michael Schneider
11215bf97f [Automatic Hierarchy Management] Rename IHM to automatic hierarchy management and move out of beta header (#2066)
* Rename automaticHierarchy to automaticallyManagesSubnodes

* Comment adjustments
2016-08-15 12:06:06 -07:00
Michael Schneider
93be894e0c [ASCollectionView / ASPagerNode] Move constrainedSizeForNodeAtIndexPath from the DataSource to the Delegate (#2065)
* Move constrainedSizeForNodeAtIndexPath from the DataSource to the Delegate in ASCollectionView and ASPagerNode

* Fix ASPagerNode declaration of dataSource and delegate

As ASPagerDataSource does not inherit from ASCollectionDataSource it's not possible to declare it as property.

* Update comment
2016-08-12 15:37:23 -07:00
Hannah Troisi
2afd063b10 [ASRangeController] Debug overlay to show the size and direction of display + fetchData ranges during scrolling. (#2008)
* Rebase ASRangeController diff with master.

* fix Table / CollectionNode debug label names
- now returns class names rather than generic ASTableNode, ASPagerNode
- ASPagerNode will be labeled as ASPagerNodeProxy (not sure how to get around this)

* refactor layout code: use ASDk's own resizeableRoundedCorner... methods

* Fixes and cleanup for manual layout version of range controller debug overlay.

I am working on a layout spec-based version, but it has some issues, so landing this to get the near-term value is probably the best next step.

* Remove .orig and .rej files.

* One last .orig file to remove.

* Final project file cleanup and tweaks to implementation for ASTableNode.

* fix build issues

* fix arrow directions
2016-08-11 11:23:07 -07:00
Adlai Holler
1fbf8ad073 [ASDataController] Cancel if we lose our data source, fix bugs (#1987)
[ASRangeController] We're already on main thread, remove blocks

Make data source read-only, clarify what's asynchronous

[ASDataController] Clean up some interfaces

[ASDataController] A little more cleanup

[ASDataController] Cleanup

[ASDataController] Restore some changes, exit more often

[ASDataController] Use item counts that we already have rather than requerying them

[ASDataController] Revert weakifications

[ASDataController] Add a mechanism to measure how much work we avoided
2016-08-05 15:39:33 -07:00
Adlai Holler
4725035f21 [ASTableView/ASCollectionView] Flush pending updates before selecting/scrolling to item (#2034) 2016-08-04 13:19:14 -07:00
Hannah Troisi
f5b3a282af Fix Pinterest Xcode 7.3.1 Analyzer Warnings (#1988) 2016-07-27 08:23:16 -07:00
Adlai Holler
7ec6f07953 [General] Remove dead code, check optional protocol selector before calling (#1970) 2016-07-22 13:09:28 -07:00
Adlai Holler
3ebddb6837 [ASCollectionView] Move the variable in 2016-07-20 13:06:00 -07:00
Adlai Holler
6a13c0365b [ASCollectionView] Do not suppress empty updates 2016-07-20 12:53:01 -07:00
Adlai Holler
50e8ad2e7c [ASTableView/ASCollectionView] Ignore bounds.origin when checking for zero-size 2016-07-18 12:17:42 -07:00
Adlai Holler
dda7accd8e [ASCollectionView] When resizing, invalidate after remeasuring all nodes (#1931) 2016-07-15 16:32:23 -07:00
Michael Schneider
ce98e56352 Use getter of layout inspector to create it lazily and not have to create it at initialization time 2016-07-13 16:36:48 -07:00
Michael Schneider
30bb2ee93d Address comments from @levi 2016-07-13 16:36:48 -07:00
Michael Schneider
9fb3129a0e Add default ASCollectionViewLayoutInspecting for custom ASCollectionViewLayout 2016-07-13 16:36:48 -07:00
Michael Schneider
35c860c183 Refactor usage of ASCollectionViewLayoutInspecting
- Fix not using itemSize of UICollectionViewFlowLayout
- Move automatic constrained size calculation to the ASCollectionViewFlowLayoutInspector
- Provide a null layout inspector for throwing exceptions if a custom
  UICollectionView is given but no ASCollectionViewLayoutInspecting
- Fix not checking for optional layout inspecting data source methods
  are implemented or not
- Improving tests around ASCollectionViewLayoutInspecting
2016-07-13 16:36:48 -07:00
Adlai Holler
edb4e45c24 [ASRangeController] Update synchronously when possible 2016-07-12 14:36:20 -07:00
appleguy
3b2af7eb6d [Build] Remove Unused Imports across all of AsyncDisplayKit. This uses a feature of AppCode. (#1875)
Details on the tool are here: https://www.jetbrains.com/help/idea/2016.1/optimizing-imports.html
2016-07-09 17:20:59 -07:00
Scott Goodson
f0ff9c108d Merge branch 'master' of git://github.com/kielgillard/AsyncDisplayKit into kielgillard-master 2016-07-09 15:44:31 -07:00
Adlai Holler
38fab7cd94 Merge pull request #1816 from hannahmbanana/selectionBug
[ASCellNode] Fix selection / highlight implementation
2016-07-08 15:48:22 -07:00
Adlai Holler
b1626b0f69 Merge pull request #1791 from colinmcardell/ASCollectionDataController_supplementaryNodeOfKind-fix
[ASCollectionDataController] Exposing -supplementaryNodeOfKind
2016-07-08 12:50:32 -07:00
Adlai Holler
8e1c8acb54 Merge pull request #1861 from facebook/AHCollectionViewLayerRetaining
[ASCollectionView] Add strong Layer Pointer Under iOS < 9 to Workaround Crashes
2016-07-07 18:26:02 -07:00
Adlai Holler
54ee62f002 [ASCollectionView] Add a strong pointer from ASCollectionView -> layer under iOS < 9 to workaround issue 2016-07-07 10:36:41 -07:00
Michael Schneider
94ca363936 Add return type to the shouldNotAnimateBlock 2016-07-07 07:00:07 -07:00
Kiel Gillard
6a15ab6130 * Tidy the header imports, forward declaring classes and protocols where appropriate to avoid import cycles and using the framework/system header notation for imports occuring in .h files.
* Perhaps controversially, decomposing ASRangeControllerUpdateRangeProtocol+Beta.h such that the categories on various classes are defined in the classes themselves since that's where the implementation of those categories is provided.
* Updating unit tests and import other headers the tests took for granted. The tests could probably import the umbrella header and not have to worry about this.
* Updating the "Life without Cocoapods" sample to build and run dependent on ASDK as a static library.
* Added a "Life With Frameworks" sample app to build and run dependent on ASDK as a framework, proving the framework targets work.
2016-07-07 15:12:19 +10:00
Adlai Holler
c62a4d3e79 [ASCollectionView] Greatly Improve Cell Node Resizing (#1853)
* [ASCollectionView] Initial pass at reducing double-sided animations

* [ASCollectionView] Always suppress animation during node size requery

* [ASCollectionView] Rejigger the invalidation logic to support animated size changes

* [ASCollectionView] Remove unused header

* [ASCollectionView] Change comment

* [ASDataController] Remove unused variable

* [ASCollectionView] When relayout animated due to cell size change, wait until next layout pass

* [ASCollectionView] Invalidate layout synchronously

* [ASCollectionView] Only read the layout object once

* [ASCollectionView] When size changes, wait for requery before layout

* [ASCollectionView] Sort of go back to using an empty update to handle node resizing

* [ASCollectionView] Remove unused constant

* [ASCollectionView] Address PR comments

* [ASCollectionView] Prevent nested [super performBatchUpdates:] calls
2016-07-06 14:13:52 -07:00
Hannah Trosi
f6d30b668d add comments to deprecated getter methods, remove extraneous if statements 2016-07-05 21:30:09 -07:00
Hannah Trosi
3994f2089c [ASCellNode] Final revisions to behavior of setSelected: & setHighlighted: 2016-07-05 17:47:00 -07:00
Michael Schneider
c20f452dca Remove check for [UIDevice systemVersion] check if running on iOS 7 (#1843) 2016-07-03 21:47:35 -07:00
Hannah Trosi
61d7c093a1 Merge branch 'master' into selectionBug 2016-07-02 11:50:19 -07:00
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
Adlai Holler
a77a6eaaf5 Merge pull request #1820 from gazreese/ASCollectionView-tuning-parameters
[ASCollectionView] Tuning parameters not set
2016-07-01 15:09:01 -07:00
Colin McArdell and Robin Chou
9c13018568 Updates exposed method signature and docs for what is now -supplementaryNodeForElementKind:atIndexPath: on ASCollectionView. Assert non-nil for usage of ASCollectionDataControllers -supplementaryNodeOfKind:atIndexPath: within ASCollectionView 2016-06-27 11:05:53 -04:00
Colin McArdell and Robin Chou
d69dd880a5 Exposing supplementaryNodeOfKind:atIndexPath: in the ASCollectionView interface. 2016-06-27 11:05:11 -04:00
Gareth Reese
d55621c285 [ASCollectionView] Tuning parameters not set 2016-06-27 14:07:00 +01:00
Hannah Trosi
2e4b1ea053 [ASCellNode] Fix selection / highlight implementation 2016-06-25 00:22:28 -07:00
Adlai Holler
9c70cec8d8 Improve update handling more 2016-06-24 11:12:37 -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