28 Commits

Author SHA1 Message Date
Adlai Holler
9cd0d58373
Rename ASDN C++ namespace to AS (#1366)
* Rename ASDN C++ namespace to "AS." Referring to the framework as ASDisplayNode is pretty out-dated and verbose. See CoreAnimation which usees CA for their internal namespace.

More using

* More cases
2019-03-09 12:14:58 -08:00
Adlai Holler
2a4b77b6d5
Remove let and var macros now that we're all-C++ (#1312)
* Remove let and var macros now that we're all-C++

* Another fix

* More!

* And more!
2019-01-17 10:16:53 -08:00
Michael Schneider
7a782f8176 Fix deprecated implementations warning (#1306) 2019-01-16 18:28:37 -08:00
LiuJian
c6fc05d9e6 Set automaticallyAdjustsContentOffset to ASTableView when view is load (#1278)
* Set automaticallyAdjustsContentOffset when view is load

* [ASTableNode] Update test: set automaticallyAdjustsContentOffset before view is load (#1278)
2018-12-11 19:32:43 -08:00
Michael Schneider
c958812ed6
ASTableNode init method match checks from ASCollectionNode (#1171) 2018-10-20 09:45:19 -07:00
Max Wang
affddb0e96 Set default tuning params (#1158)
* fix SIMULATE_WEB_RESPONSE not imported #449

* Fix to make rangeMode update in right time

* remove uncessary assert

* Fix collection cell editing bug for iOS 9 & 10

* Revert "Fix collection cell editing bug for iOS 9 & 10"

This reverts commit 06e18a10596622ff8a68835c95a23986d7bf61ea.

* Only test when photo library is enabled.

It will fail to build if photo library is disabled cause the test is
depending on it.

* Add ChangeLog.

* set default tuning parameters for collection/table node

* add change log

* Move to framework private.

* Apply to tableNode

* trigger ci

* fix directory

* fix file link
2018-10-10 10:46:33 -07:00
Eric Jensen
565da7d493 Add missing NS_NOESCAPE in overwritten methods (#1139)
Fixes -Wmissing-noescape warnings
2018-10-04 09:33:08 -07:00
Michael Schneider
cd608c9b18
Remove necessity to use view to access rangeController in ASTableNode, ASCollectionNode (#1103) 2018-09-19 07:51:46 -07:00
appleguy
465abb1ded [License] Simplify the Texture license to be pure Apache 2 (removing ASDK-Licenses). (#1077)
* [License] Simplify the Texture license to be pure Apache 2 (removing ASDK-Licenses)

With permission of the Facebook Open Source team, we are simplifying the Texture
license so that clients can rely on the Apache 2 terms that most of Texture is
already covered by. This means that code originally forked from AsyncDisplayKit
will be re-licensed from "BSD 3-clause + PATENTS v2" to Apache 2 without a
PATENTS file.

After getting confirmation that the updates to these core files look good, we'll
propagate this new license header to all files (in this same PR) and get sign-off
from all parties before landing.

* [License] Update all Texture source files to be pure Apache 2.

* Changelog entry for Apache 2 license update.

* Revert "[License] Update all Texture source files to be pure Apache 2."

This reverts commit ffa0fbbba9717d871dd16c4b07539f2f8208fc2b.

* [License] Update all Texture source files to be pure Apache 2, maintaining copyrights.

* [License] Update CONTRIBUTING, README, Podspec & Dangerfile.
2018-08-28 07:39:18 -07:00
Adlai Holler
cac14e0bce
Standardize Property Declaration Style in Core Classes (#870)
* Audit property attributes for core classes

* Update style guide

* Go crazy

* Update changelog
2018-05-24 14:42:43 -07:00
appleguy
a41cbb48b3
[ASWrapperCellNode] Introduce a new class allowing more control of UIKit passthrough cells. (#797)
* - [ASWrapperCellNode] Introduce a new class allowing more control of UIKit passthrough cells.

A few minor fixes to Collections behavior as well, including a new isSynchronized
API. The difference from processingUpdates is that after Synchronized, all animations
have also completed (or runloop turn if animations disabled, so .collectionViewLayout
can be relied on being fully in sync).

More upstreaming to come after this can land...

* Fix -[ASDataController clearData] to take no action before initial data loading.

* Empty commit to kick CI

* Spacing change to kick CI (since an empty commit doesn't work...)

* Tweak ASDataController changes to handle an edge case in _editingTransactionQueueCount management.

* Avoid excess cyclic calls to onDidFinishProcessingUpdates: by avoiding ASMainSerialQueue.

* Reverting my initial change as it wasn't the right approach, following the real fix before this.
2018-03-13 01:03:18 -07:00
Adlai Holler
8b431733d3
Avoid triggering main thread assertions in collection/table dealloc #trivial (#803)
* Avoid triggering main thread assertions in ASCollectionNode/ASTableNode dealloc

* Put it back
2018-02-13 12:02:30 -08:00
Max Wang
479d40464e [ASTableNode & ASCollectionNode] Keepalive reference for node if their view is necessarily alive (has a superview). (#793)
* fix SIMULATE_WEB_RESPONSE not imported #449

* Fix to make rangeMode update in right time

* Keep collection/table node alive if view still in use.
2018-02-09 12:16:18 -08:00
Huy Nguyen
fcee108af5 [ASCollectionNode][ASTableNode] Add content inset bridging property (#560)
* Add content inset bridging property to table and collection nodes

* Fix CHANGELOG

* Fix typo

* Minor fixes
2017-09-11 19:20:32 +01:00
appleguy
ccc5786032 [ASCollectionNode] Add -isProcessingUpdates and -onDidFinishProcessingUpdates: APIs. (#522)
* [ASCollectionNode] Add -isProcessingUpdates and -onDidFinishProcessingUpdates: APIs.

Over time, there have actually been a lot of legitimate uses for an API like this.
In fact, I'm not quite sure what has held us back from adding one!

I believe that at least some portion of -wait calls (even if less than 50%) could be
replaced with -onDidFinishProcessingUpdates:, which could potentially improve the
performance of applications using -wait by a significant amount.

Please take a close look at implementation correctness. Although I'm in a bit of a
rush, I'm aiming to make this properly documented and added a basic test -- but it
could certainly use some more detailed testing as a followup.

* [ASCollectionNode] Improvements to the implementation of -isProcessingUpdates and -onDidFinishProcessingUpdates:

* Add lock to ASMainSerialQueue count method.

* [ASTableNode] Implement -isProcessingUpdates and -onDidFinishProcessingUpdates:. Rename -waitUntil to consistent naming.
2017-08-23 11:16:21 +01:00
Huy Nguyen
dc3be352af [ASTableNode][ASCollectionNode] Add content offset bridging property (#460)
- Add content offset bridging property to table and collection node
- And use it in `ASCollectionLayout` to avoid measuring unrelated nodes during the first layout.
- Update CHANGELOG and highlight deprecated methods
2017-08-10 17:47:26 +01:00
appleguy
03592e0669 [ASDisplayNode] -didEnterPreloadState does not need to call -layoutIfNeeded #trivial (#411)
This was originally added for ASCollectionNode and ASTableNode preloading to work
as intended when nested inside of another ASRangeController-powered node. Indeed,
it is still necessary to trigger layout on these UIKit-backed components in order
for their own ASRangeControllers to start preparing content within them.

However, unlike the comment suggests, it is *not* necessary to do this for image
nodes. ASNetworkImageNode has only one .URL, and does not use the .bounds or
.calculatedLayout at all during loading. Even the ASMultiplexImageNode does not
use the .bounds, and the ASMapNode uses .calculatedLayout instead of .bounds.

This change has important performance benefits. In particular, it avoids
layouts that would occur on the main thread, often including text sizing,
and also can result in redundant layout passes (even during a layout pass that
triggers a node to enter the preload range, it may force its own layout early).

It would be great to test this change with Pinterest to confirm its safety, but
based on a full audit of the framework codebase, the only possibility that I
see for a regression is if app implementations of -didEnterPreloadState make
direct use of .bounds instead of .calculatedLayout (which is easy to fix).
2017-07-05 19:07:43 +00:00
Huy Nguyen
8c45eaefce [Batch Fetching] Add ASBatchFetchingDelegate (#281)
* Add ASBatchFetchingDelegate
- In addition to checking remaining leading screens, ASBatchFetching now also calculates a remaining time and consults its delegate if needed.
- The delegate can override the decision of ASBatchFetching, for example based on remaining time and average time of past batch requests.

* Fix up tests

* Update CHANGELOG
2017-05-17 13:26:30 +01:00
Adlai Holler
588f30c7dd Move Last Few Properties from ASTableView,ASCollectionView to Node (#225)
* Finish moving properties ASTableView->ASTableNode, ASCollectionView->ASCollectionNode

* Update changeling
2017-05-04 13:41:58 +01:00
Adlai Holler
a7656766f9 Make Cell Node Properties Atomic (#74)
* Make ASCellNode indexPath and supplementaryElementKind atomic

* Update the change log

* Fix licenses

* Be explicit with atomic

* Rename the protocol

* And the file
2017-05-02 14:09:12 -07:00
Garrett Moon
8013e25524 Update license v2 (#67)
* Fixed license

* Update all licenses

* Update Dangerfile for new license

* Update already updated licenses

* Closer…

* Closer…

* Closer…

* Closer…

* Closer…

* Closer…

* Closer…

* Closer…

* Closer…

* Closer…

* Closer…
2017-04-24 16:59:57 -07:00
Huy Nguyen
dcf858eac1 [ASDisplayNode] Trigger a layout pass whenever a node enters preload state (#3263)
* Add a thread-safe layoutIfNeeded implementation to ASDisplayNode

* Trigger a layout pass when a display node enters preload state
- This ensures that all the subnodes have the correct size to preload their content.

* ASCollectionNode to trigger its initial data load when it enters preload state

* Minor change in _ASCollectionViewCell

* Layout sublayouts before dispatch to main for subclass hooks

* Update comments

* Don't wait until updates are committed when the collection node enters display state

* Same deal for table node

* Explain the layout trigger in ASDisplayNode
2017-04-13 16:25:17 -07:00
Huy Nguyen
c642771e1c Remove unused initializer in ASTableNode (#3268) 2017-04-13 16:11:32 -07:00
Huy Nguyen
3d19923731 [Trait collection] Correctly handle changes that occur mid-updates (#3224)
* Add unit test to test trait collection changes occur during updates are handles correctly

* Remove handling code in ASDataController:updateWithChangeSet. Previous test should fail

* Correctly handle trait collection changes that occur mid-updates
- Currently, when there is a new trait collection, we correctly propagate it to all visible elements. However, since the propagating block is executed on main thread immediately without waiting for the background editing queue of ASDataController, not all elements are updated.
- Then to fix that, we updated ASDataController to handle these changes inside updateWithChangeSet. This works, but it doesn’t address the underlying issue.
- We now delegate the propagating task to ASDataController which schedule a block to its main serial queue after waiting for its background editing queue.
2017-03-31 10:47:59 -07:00
Adlai Holler
fcbbea51a6 Fix the Initialization Hierarchy (#3207)
* Fix the initializers setup

* Update Swift example

* Remove incorrect comment

* Add one to ASTableNode
2017-03-28 11:48:20 -07:00
Huy Nguyen
bf41847665 Don't load collection/table node just to wait for updates to be committed (#3182)
- Because there would be no update otherwise.
2017-03-15 08:55:50 -07:00
Adlai Holler
bccfc6c779 Don't Load Table/Collection Node Just Because User Updated (#3120)
* Allow user to update collection/table without forcing view to load

* Capture animation enabledness
2017-03-02 10:11:30 -08:00
Adlai Holler
73ca6ab514 Shuffle & Cleanup Stuff (#3080) 2017-02-26 18:14:13 -08:00