* Add default fade in / out layout transition
* Add example for layout transition
* Update for recent layout transition API changes
* To be able to do a layoutTransition the node needs to be loaded
* Rename layoutTransitionDuration to defaultLayoutTransitionDuration
* Expose default layout transition duration delay and options
* Use `UIViewAnimationOptionBeginFromCurrentState` for initial defaultLayoutTransitionOptions
* 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
* [ASVideoNode] Use the videoComposition when generating images.
* [ASVideoNode] Improve playerState behaviour.
* [ASVideoNode] Use KVO on _player.rate to determine the playerState.
* 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
* [Optimization] Convert to type-generic math
* add std:: prefix in obj-c++ files
* more cleanup
* revert test changes
* convert min and max back to fmin/fmax
[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
The pending layout transition needs to stay alive at least until applySubnodeInsertions did finish execute as it can happen that with Implicit Hierarchy Management new nodes gonna be added that internally call setNeedsLayout what will invalidate and deallocate the transition in the middle of inserting nodes
Using Objective-C attributes, in this case `unavailable`, we can hide
unsupported APIs at compile time instead of detecting and warn about it
at runtime with a set of asserts.
* Revert "Revert "[ASLayoutSpec] Use childrenMap directly to prevent creating an NSArray within ASDK (#1937)""
This reverts commit 735b4ebd0872483044d98a5d05b43324e76fc8d4.
* Fix crash and add exception for mutating while using fast enumeration of ASLayoutSpec children
NSFastEnumeration is potentially quite dangerous in the wrong hands. In particular, it does not provide a safe mechanism for you to return temporary objects directly, and it does not provide any guarantee that you will be called when the enumeration has completed; therefore if we generate temporaries and store them in an instance variable, we will not necessarily be able to clean them up! This means fast enumeration methods should never be called within an autorelease pool or the autorelease pool be drained within the fast enumeration loop.
The reason is we store references to objects in the stackBuf struct by casting the child pointer to __autoreleasing id. If we pop the autorelease pool between calls to -countByEnumeratingWithState:objects:count:, it will die in a messy explosion of pointer dereferences and EXC_BAD_ACCESS.
* Add tests for ASDisplayNode and ASLayoutSpec fast enumeration
If a node was added to a supernode, the supernode could be in a layout pending state. All of the hierarchy state properties related to the transition need to be copied over as well as propagated down the subtree. This is especially important as with Implicit Hierarchy Management adding subnodes can happen while a transition is in fly
Something interesting going on here with ARC / Objective-C++ that we are investigating and will re-land.
This reverts commit c90ed08d1073701e2c7f8a2677d460c140f05264.
This triggers on existing code that needs to be updated, but also there is some investigation
needed as to whether it is a valid use case to have a >1.0 value in order to position greater-than-bounds elements.
* [ASDisplayNode] Ensure that nil can never be returned from -measureWithSizeRange:
This can happen in rare cases when multiple relayouts occur while a transition is being measured.
* [ASDisplayNode] Use ternary operator style for nil check.
* Use childrenMap directly to prevent creating an NSArray in ASDK for ASLayoutSpec children
* Add locking for parent property in ASLayoutSpec
* Remove unnecessary import
* Add newline
* Add NSFastEnumeration to ASEnvironment and ASDisplayNode / ASLayoutSpec
* Change NSMutableArray initializer to arrayWithCapacity:
* Move ASLayoutSpec+Private.h into Private folder
Fixes building with Swift
* Remove lock for ASLayoutSpec parent
* Simplify applying layout transition in preparation for bigger layout transition API work
* Change from apply to complete in if layout transitions are involved and _applyLayout: to _setCalculatedLayout: for layout
* Change to applySubnodeInsertions and applySubnodeRemovals
* Change from completeTransition to commitTransition and flip logic around when to trampoline to the main thread for implicit hierarchy management
* More internal API improvements
* Fix merge conflicts
* Rename _layout to _calculatedLayout
* Fix ASTextNode's ascender to also include the line height specified by paragraph style in the attributed string.
* Merge conflict (original patch is for an old version)
* [ASEnvironmentTraitCollection] default user interface idiom to ASEnvironmentTraitCollection
UIUserInterfaceIdiomUnspecified is -1 so we were actually defaulting our trait collection to UIUserInterfaceIdiomPhone (which is 0).
* Fix a few places where we weren’t using the default method to create the base traits