* Make ASCellNode indexPath and supplementaryElementKind atomic
* Update the change log
* Fix licenses
* Be explicit with atomic
* Rename the protocol
* And the file
* Add _ASCollectionReusableView container for ASCollectionNode supplementary nodes with applyLayoutAttributes support
• Adds support for -[ASCellNode applyLayoutAttributes:] to supplementary nodes
* Ensure _ASCollectionReusableView has layoutAttributes if the collection view doesn’t set them
* Use correct layoutAttributes accessor for supplementary elements
* Introduce ASCollectionViewLayout
- `ASCollectionViewLayout` is an async `UICollectionViewLayout` that encapsulates its layout calculation logic into a separate thread-safe object which can be used ahead of time and/or on multiple threads.
- `ASDataController` now can prepare for a new layout resulted from a change set before `ASCollectionView` even knows about it. By the time the change set it ready to be consumed by `ASCollectionView`, its new layout is also ready.
- New `ASCollectionViewLayoutCalculating` protocol that is simple and generic enough that many types of calculators can be built on top. `ASCollectionViewLayoutSpecCalculator` conforms to `ASCollectionViewLayoutCalculating` protocol and can be backed by any layout spec (e.g `ASStackLayoutSpec`, `PIMasonryLayoutSpec`, etc). We can even build a `ASCollectionViewLayoutYogaCalculator` that uses Yoga internally.
- A built-in `ASCollectionViewFlowLayoutCalculator` that is a subclass of `ASCollectionViewLayoutSpecCalculator` and uses a multi-threaded multi-line `ASStackLayoutSpec` internally. The result is a performant and thread-safe flow layout calculator.
- Finally, `ASCollectionViewLayout` can be subclassed to handle a specific type of calculator with optimizations implemented based on the knowledge of such calculator. For example, `ASCollectionViewFlowLayout` can have a highly optimized implementation of `-layoutAttributesForElementsInRect:`.
Protocolize layout calculator providing and consuming
Add flex wrap documentation
Add a `multithreaded` flag to ASStackLayoutSpec that forces it to dispatch even if it's off main
- Update ASCollectionViewFlowLayoutSpecCalculator to use that flag.
Minor change in ASCollectionViewLayout
Implement Mosaic layout calculator
Minor change
Fix project file
Rename and fix project file
Skip fetching constrained size only if a layout calculator is available
Update examples/ASCollectionView
Remove unnecessary change in ASTableView
Address comments
Rename collection view calculator protocols
Minor changes after rebasing with master
Add ASLegacyCollectionLayoutCalculator for backward compatibility
Remove ASCollectionLayoutSpecCalculator
Remove ASLegacyCollectionLayoutCalculator
Introduce ASCollectionLayout
- A wrapper object that contains content size and an element to rect table.
- Collection layout calculators to return this new object instead of an ASLayout.
Before adding a content cache
Finishing hooking up ASCollectionLayoutDataSource to ASCollectionNode
Stash
Finish ASCollectionLayout
Rough impl of ASCollectionFlowLayout
Revert changes in CustomCollectionView example
Move ASRectTable back to Private
* Rename ASCollectionContentAttributes to ASCollectionLayoutState
* Address other comments
* Introduce ASCollectionLayoutDelegate and make ASCollectionLayout private
* Address comments
* API tweaks:
- Replace `-layoutContextWithElementMap:` in ASCollectionLayoutDelegate with `-additionalInfoForLayoutWithElements:`. The returned object is then stored in ASCollectionLayoutContext for later lookups.
- ASCollectionLayoutContext has no public initializer.
- ASDataControllerLayoutDelegate no longer requires a context of type ASCollectionLayoutContext but simply an `id`. This helps decouple ASDataController and ASCollectionLayout.
- Rename `elementMap` to `elements`.
- Rename `visibleMap` to `visibleElements`.
- Other minor changes.
* Rename ASCGSizeHash to ASHashFromCGSize
* Make sure to call super in -[ASCollectionLayout prepareLayout]
* Update example/ASCollectionView to use ASCollectionFlowLayoutDelegate
* Remove unnecessary change
* Need to check availability before use of macros.
* Get rid of PCH and enforce macro definition.
* Remove prefix
* Switch to global warning instead, much better.
* Clean up snapshot test cases:
- Drop 32bit snapshots
- Update iOS 9 snapshots and move some others to the correct directory
- Remove `setUp` overrides in subclasses of `ASLayoutSpecSnapshotTestCase` that set `recordMode` flag. Doing so in multiple places make it difficult to enable/dis
able the flag for all layout spec test cases. It can always be overridden locally if need
to.
- Fix BUCK build
* Fix testThatOnDidLoadThrowsIfCalledOnLoadedOffMain of ASDisplayNodeTests
* Build ASElementMap and use it
* Keep building!
* Clean up
* Restrict ASDataController subclassing
* Clean up more
* More rearranging
* Dear lord it's time for bed
* Make things clearer
* Sadly remove subclassing restriction for ASDataController
* Remove dead initializer
* Refactor ASDataController
Check optional methods in ASDataControllerSource
* Reimplement reloadData
* Refactor new code
- No more new/inserted contexts flag
- Encapsulate code shared between reloadData and updateWithChangeSet
- Remove dataControllerWillDeleteAllData delegate method
- Hierarchy changes no longer needs to conform to NSCopying
- Reword TODOs
* Forgot to call completion block of reloadData :P
* Completion block of -[ASDataController reloadDataWithCompletion:] is nullable
* Data queried from ASCollectionNode and ASTableNode should be in UIKit index space
- This helps to avoid immature node allocation, especially when node virtualization is a thing
- However, this means that -reloadDataInitiallyIfNeeded in ASCollectionNode and ASTableNode must wait until all updates are finished.
* ASDataController shouldn't assume that allocated nodes were also laid out
* Revert "Data queried from ASCollectionNode and ASTableNode should be in UIKit index space"
This reverts commit 7bc977b3808a92f484b297781d0f5b30aa258e17.
* -nodeAtIndexPath: of ASDataController now forces node allocation, with the assumption that clients absolutely need it.
- Revisit this when node virtualization is implemented.
* ASDataController only grab changeSet.completionHandler when needed because it'll be niled out
* Fix ASTableViewTests related to reloadData
* Fix testThatDeletedItemsAreMarkedInvisible in ASCollectionViewTests
* Minor changes in ASCollectionView and ASTableView
* ASCollectionView and ASTableView shouldn't call [super reloadData] before their data controller does anything
* Address comments
* Fuse reloadData into -updateWithChangeSet: of ASDataController
* reloadData shouldn't be called as if it's inside a batch
- It can't be used in conjuntion with other updates.
- Calling it inside a batch update during the initial load can cause data inconsistency thrown by UICollectionView/UITableView
* Refactor ASDataControllerDelegate and ASRangeControllerDelegate
- Replace delegate methods in these protocols with -willUpdateWithChangeSet and -didUpdateWithChangeSet.
- ASRangeController, ASCollectionView and ASTableView are simplified because of this.
* Fix mismatch between sorting orders in ASDataController
* Forgot to call completion handler of reload change sets
* Make sure ASCollectionView is compatible with the behavior of UICollectionView's reloadData
- Since UICollectionView's reloadData doesn't requery data source but defers until the next layout pass, we need to wait until then to update range controller and do batch fetching.
- `-[ASCollectionView waitUntilAllUpdatesAreCommited]` needs to force a layout pass to make sure
everything is ready after it returns.
* testSectionIndexHandling of ASTableViewTests should only check visible nodes. Other nodes will be re-measured later.
* ASTableView is not ready until the first layout pass finished
* Address comments
* Bug fixes
* Fix pager node and deprecate zeroContentInsets flag
* Do it with the visible state callback
* There we are
* Put viewController in node debug description
* [Yoga + AsyncDisplayKit] Initial commit for supporting Yoga-powered layout calculation.
Because this results in ASLayout objects, it preserve support for automaticallyManagesSubnodes
as well as the animated transition system. More work remains to vet performance of the new mode,
and it will remain in +Beta for the forseeable future.
I'm not sure that this should ever be used as the primary ASDK layout system, but it should remain an
option for some apps to experiment with if they require an implementation that more strictly mirrors
W3C standard Flexbox.
* [Yoga] Improve usage of ASHierarchyState to ensure simultaneous yoga layouts can't happen.
* [Yoga] Strictly minimize the impact of the Yoga integration on existing code.
Created new file ASDisplayNode+Yoga.mm, reduced size and number of integration points in core code.
* [Yoga] Figured out how to further reduce ASDisplayNode.mm impact by allocating _yogaNode in property accessor, and changing all accesses to use the property.
This also supports supplementary nodes. It builds off of Adlai's .interop flag but makes necessary
improvements for all of the delegate methods to work in practice with heterogenous cell types.
* [ASNodeController] initial commit for node controller class
* create <ASInterfaceState> protocol, -[ASDisplayNode interfaceDelegate], and use these to forward to ASNodeController
* rename ASInterfaceStateDelegate, fix setting in it ASNodeController.mm
* Reimplement IGListKit support in a cleaner way
* Rename and fix some stuff
* Fix supplementaries more
* Update docs
* Update test
* Cleanup minor things
* Tweak it
* Indentation
* Remove irrelevant changes
* Break out cell into its own file
* Fix indentation
* Address feedback
* Start removing ASChangeSetDataController
* Continue removing ASChangeSetDataController
* Remove unnecessary change
* ASDataController is no longer an abstract class, remove its assertion
* Get back beginUpdates and endUpdatesAnimated:completion in ASCollectionNode
* Remove duplicate import
* Move `ASLayoutController` related code out of CoreGraphics+ASConvenience
* Further cleanup
* Move private layout files to Privat/Layout
* Move ASLayoutElementStylePrivate into Private/Layout
* Further cleanup
* Move tvOS related files to tvOS folder
* Further cleanup
* Add tests for baseline alignments
* Merge baseline alignment algorithm to the main stack algorithm
- Baseline alignment is now part of the main stack algorithm.
- ASStackBaselinePositionedLayout is no longer needed and removed.
* All snapshot test cases of ASStackLayoutSpec are passing now
* Remove baselineRelativeArrangement
* Remove TODO
* Minor fixes in cross size determination step
* WIP
* Calculate TextKit Height based on max lines to display
* Remove TODO
* Calculate height based on lineFragmentRect
* Fixes issue with calculated width
* Resolve TextKit stack threading issues
* Removes blank lines
* Open brace on next line
* setNeedsLayout in case of changes on live node
* [ASDisplayNode] Ensure all subclasses are using base class __instanceLock__ and not re-defining their own.
This also moves the @package definition of the instance variable to +FrameworkPrivate instead of Internal.h,
because Internal.h should ideally not be used outside of the ASDisplayNode file setup. This has greatly reduced
the number of imports of Internal.h.
* [ASDisplayNode] Add ASDisplayNode+FrameworkSubclasses.h to share __instanceLock__ definition.
* [ASScrollNode] Support for automaticallyManagesContentSize, adopting the ASLayoutSpec's size as the scrollable contentSize.
This feature has been desired for a long time, and has turned out to be phenomenally useful and easy to use.
It works well either for a blank ASScrollNode with .layoutSpecBlock set on it, or a subclass of ASScrollNode with a more
traditional layoutSpecThatFits: implementation. With this approach there is no need to capture the layout size, use
an Absolute layout spec as a wrapper, or set contentSize anywhere in the code and it will update as the layout changes!
There is no automatic management of contentInset, but it would make sense to add this with keyboard listeners in the future.
* [ASScrollNode] Add locking to new properties, adjust how calculateLayout override is done.
Be more aggressive with main thread punting
Trampoline setting the dataSource/delegate onto the main thread
Short-circuit the supplementary nodes method if no data source
Don't rely on assertions
Mark variable unused to fix release builds
Handle ASCollectionNode/ASTableNode deallocation better
Add some comments about new macro
* Initial ASLayoutSpecPlayground commit
* Initial exploratory stab at the main challenge of the app - visualizing ASLayoutSpecs
* Halfway through moving debug features out of ASDK framework files and into debug files. Project builds.
* [ASLayoutSpecPlayground] Created new Inspector node, cleaning up internal implementation to start formalizing support for layout spec visualization.
* Workaround for ensuring creation of visualizerNode for ALL layoutspecs
* continued development
* Layout Inspector Work in Progress
* Resizing the playground works in the shrink direction, not for grow.
* added new ASLayoutableInspectorNode features
* Cleaned up examples code.
* Cleaning up code.
* more code cleanup
* [ASLayoutableInspector] Transition to an ASTableNode-based architecture to support larger numbers of buttons / customizable types.
* [ASLayoutableInspector] Support different layoutable property types to set up buttons that can edit all of them.
* Huy debugging
* Refactored layout inspector code for extensibility.
* Properly lock layoutableContextMap
* Fix context handling in ASDisplayNode:measureWithSizeRange
* Fix ASLayoutSpecPlayground:ViewController:toggleVisualization
* added slider to InspectorCell
* [ASLayoutSpecPlayground] Improvements to propagation of visualize mode, resize handle, minor cleanup.
* Fix to ASEnvironment
* [ASLayoutSpecPlayground] Fix a few minor issues from the merge with latest master.
* Implement layout spec cache
* add pager ndoe
* add more examples
* add more layout examples
* [ASLayoutPlayground] Fix merge issues
* [ASLayoutPlayground] Fix up the example project from the 2.0 API changes.
* [ASLayoutPlayground] Some fixes (#2411)
* [ASLayoutPlayground]: Some fixes
* Fixed crash when tapping descender.
* Fixed setting the item to inspect.
* Fixed button states in inspector node.
* Added sliders for spacingBefore, spacingAfter, ascender.
* [ASLayoutSpecPlayground] Deselect the buttons when editing is over.
* [ASLayoutSpecPlayground] Changed flexGrow/Shrink's values from YES/NO to 1.0/0.0
* [Project] Create new Debug/ directory for advanced tools dedicated to debugging.
* [LayoutSpecPlayground] Rename project without AS in title, to be consistent with LayoutSpecExamples.
* [Bulid] Fix Xcode project to use new Debug subdirectory / group.
* [Bulid] Fix a small merge error.
* [Build] Fix build issue for Framework target.
* [Bulid] Fix podspec to expose InspectorNode header; Remove old-cocoapods emojis from ASDKgram :)
* Move aside ASLayoutSpecPlayground-Swift to match master
* [LayoutSpecPlayground] Cleanup implementation in several files, xcodeproj, etc.
* [ASControlNode] Add comment for new assertion, to be enabled in a separate diff.