* [ASDisplayNode] Remove node from supernode before adding it as a subview
If a node is being added as a subview to a UIVIew, we must make sure to remove it as a subnode of its supernode.
* remove from supernode if adding to a layer.
* Reset the alpha value for removed subnodes in layout transition to 1 after removal
* Some improvements
* Restore alpha value of inserted and removed subnodes to original alpha value in animated layout transition
* [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.
* Fix content insets are wrong in pager node if root node of ASViewController and transition back
* Add unit test
* Improve test
* Fix test
* Move tests to ASPagerNodeTests
* [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.
* Improve handling of rasterize node interface states and testing
* Fix harder
* Finish fixes and move rasterization flag into beta header
* Re-enable rasterization in ASDKgram
* Re-enable working test
* Only do it in debug
* Fix crash if layout elements are created with no owner and referenced in layoutSpecThatFits:
* Add failing test for nodes deallocated while creating in layoutSpecThatFits:
* Some more
* Some cleanup
* Added more complexity to tests
* Only cache sublayouts if the layout get’s flattened
* Address comments
* Address comments
* Fix flickering for range managed nodes
* Go back to old behavior to check for range managed before calling didExitPreloadState in interface state change
* Replace fetch data with preload terminology
- Deprecate `-fetchData` and `-clearFetchedData` in favor of `-preload` and `-clearPreloadedData`
- Move `-setNeedsPreload`, `-recursivelyPreload` and `-recursivelyClearPreloadedData` to ASDisplayNode+FrameworkPrivate.h
- Update internal implementation, comments and tests
* Folllow up on #2642:
- Remove -preload and -clearPreloadedData in favor of -didEnterPreloadState and -didExitPreloadState.
- -didEnterPreloadState and -didExitPreloadState call the deprecated -fetchData and -clearFetchedData methods if they are overriden.
* Missed one in a test
* Get rid of behavior change for now.
* Revert more behavior changes, fix tests.
* Don't need these anymore.
* Test & tweak batch fetching implementation
* Tighten the test
* Stop batch fetching at the end of range controller pass
* Clean up the test
* Still check for batch fetching after each frame when scrolling
* Ensure batch fetching happens for empty collection/table
It also fixes a couple subtle bugs:
1. If a range controller update was in flight and you were manually setting the range
mode, you could actually clear out the range mode by calling updateCurrentRangeWithMode:
This is fixed by setting _didUpdateCurrentRange = YES if _needsRangeUpdate is YES.
2. Calling setNeedsUpdate after calling updateCurrentRangeWithMode: can cause the
current range mode to get cleared out. This is because updateCurrentRangeWithMode:
will not set _didUpdateCurrentRange if _currentRangeMode == rangeMode.