Commit Graph

25012 Commits

Author SHA1 Message Date
Michael Schneider
ba5dc984d7 Check if subnodes where modified during layoutSpecThatFits: (#2164) 2016-08-28 16:55:42 -07:00
Adlai Holler
578ac4c48d [Unit Tests] Add Text Layout Performance Tests (#2161)
* Add single-threaded text node performance testing

* Relax test a bit
2016-08-28 16:47:03 -07:00
Michael Schneider
cf08f3a73e Add test for layout transition measurement completion block is called on main thread (#2162) 2016-08-28 15:55:55 -07:00
Adlai Holler
bab601460e Rearrange headers in ASXCTExtensions.h 2016-08-27 17:51:20 -07:00
Michael Schneider
d0c77d7965 Add ASDisplayNodeLayoutTests (#2157) 2016-08-27 17:36:08 -07:00
Adlai Holler
ff37535140 [Testing] Migrate Unit Tests to ARC (#2156)
* Migrate ASDisplayNodeTests to ARC

* Migrate ASDisplayNodeAppearanceTests to ARC

* Migrate ASDisplayLayerTests to ARC

* Migrate ASMultiplexImageNodeTests to ARC

* Address Garrett's feedback
2016-08-27 15:09:59 -07:00
Garrett Moon
645aa6f24b [ASDisplayNode] Renamed range update callbacks (#2130)
* Renamed range update callbacks

We finally settled on

didEnter/ExitDisplayState
didEnter/ExitPreloadState
didEnter/ExitVisibleState

This change is meant to unify the range update methods to relate to each
other and hopefully be a bit more self explanatory.

* Guarantee interface callbacks happen on main.

* move fetchData / clearFetchedData to default implementations

* Move deprecated methods to new deprecated category

* Don't bring in cocoapod change.

* Nits

* Capetalize
2016-08-26 20:18:38 -07:00
Adlai Holler
f542e8d458 [ASDisplayNode] If We Skipped Rendering Due to Zero-Area, Re-Render When We Get a Real Area (#2149)
* Add failing test case

* [_ASDisplayLayer] If we skipped render due to being zero-size, enqueue a render when we get a real size

* Remove pointless import
2016-08-26 15:51:49 -07:00
Garrett Moon
8032758176 Fixes a deadlock caused by walking up the heirarchy. (#2147)
* Fixes a deadlock caused by walking up the heirarchy.

* Use scope locker / unlocker and add a comment.

* Add comment about calling __setNeedsLayout without the lock.
2016-08-26 14:09:38 -07:00
Garrett Moon
e6e5c346de I wrote a bunch of code with the Mutex::Unlocker and didn't understand it. (#2150) 2016-08-26 14:07:18 -07:00
Michael Schneider
905508e9be Factor in constrained size for final size calculation of ASTextNode (#2146) 2016-08-26 11:55:13 -07:00
Adlai Holler
9c3b688a87 Remove textStorageCreationBlock API (#2142)
* Remove textStorageCreationBlock API

* Remove layoutManagerCreationBlock also
2016-08-26 11:42:20 -07:00
Adlai Holler
6a482dc153 [ASDataController] Use 2 Threads Per CPU When Measuring Nodes (#2145)
* [ASDataController] Use custom apply function to control thread count

* Relax the test for stupid Travis CI

* Remove unneeded import
2016-08-26 10:54:55 -07:00
Adlai Holler
480ba8c3fa [ASViewController] Remeasure node with new constrained size when propagating trait collection (#2143) 2016-08-25 21:21:44 -07:00
Michael Schneider
47d84aa7fe Add snapshot test for ASBackgroundLayoutSpec (#2131) 2016-08-25 21:18:52 -07:00
Garrett Moon
e3091737ca Enable ASRangeControllerUpdateRangeProtocol by default if view controller or node support it. (#2133) 2016-08-25 21:18:04 -07:00
Adlai Holler
04ecd4180e [ASTextKitRenderer] Shift TextKit Teardown onto the Deallocation Queue (#2136)
* [ASTextKitRenderer] Shift TextKit teardown onto the deallocation queue

* Import it!
2016-08-25 17:29:31 -07:00
ricky
b5b9eefe44 [ASViewController] Layout root node AFTER propagating all the traits (#2137)
Wait until all subnodes have the new trait collection before laying out the root node. The way I’m using `asyncTraitCollectionDidChange`, I sometimes call methods that call `setNeedsLayout` which causes a new layout pass to begin before the new trait collection has been propagated to all nodes. This leads to weird behavoir, like nodes being laid out twice in the same call stack!

This change won’t stop possibly unnecessary layout passes because of `asyncTraitCollectionDidChange`, but it will at least do a complete layout pass once we have propagated all traits.

Ultimately the solution to this problem (as Adlai pointed out) is to wait until the CA transaction commit to perform the actual layout.
2016-08-25 11:52:43 -07:00
Adlai Holler
a193a4bca4 [ASStackLayoutSpec] Create children NSArray less often (#2139) 2016-08-25 10:03:07 -07:00
Michael Schneider
f30dec5c40 Merge pull request #2134 from maicki/MSFixWarningASCALayerExtendedDelegate
Fix compiler warning in Xcode 8
2016-08-24 16:09:11 -07:00
Michael Schneider
370d0597df Fix compiler warning in Xcode 8 2016-08-24 15:56:21 -07:00
Adlai Holler
7099c4fcdc [ASImageNodeSnapshotTests] Fix issue with forced size test (#2127) 2016-08-23 22:56:30 -07:00
Garrett Moon
dfe4585cec Add ability to force the size which an image node is rendered. (#2107)
* Add ability to force the size which an image node is rendered.

* Add unit tests for forced scaling.

* Whoops, need results!

* Round forced scaling.

* Check size of contents too.

* Remove unnecessary container node.
2016-08-23 16:01:43 -07:00
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
Benjamin Scholtysik (Reimold)
f31b47545c use generics for better swift imports 2016-08-23 13:58:09 -07:00
Benjamin Scholtysik (Reimold)
448ed1b294 Fix formatting of section about attaching custom properties 2016-08-23 12:48:53 -07:00
Peter
e641db56e9 no message 2016-08-23 16:21:34 +03:00
Peter
e40b2fc77a no message 2016-08-23 16:21:20 +03:00
Peter
070905b1ae Merge branch 'master' into HEAD 2016-08-23 16:19:42 +03:00
Peter
642cb9ae2f no message 2016-08-23 16:19:36 +03:00
Peter
efe9ee147d no message 2016-08-23 16:19:22 +03:00
Peter
e0e8cc7d34 no message 2016-08-23 16:19:01 +03:00
Peter
18d6518f70 Merge commit '8edc9fe08febed871eab512a24917764c37ddbb0'
# Conflicts:
#	AsyncDisplayKit.xcodeproj/project.pbxproj
#	AsyncDisplayKit/Private/ASImageNode+CGExtras.m
2016-08-23 16:18:35 +03:00
Adlai Holler
8edc9fe08f Ensure supplementary section count tracks item section count (#2118) 2016-08-22 20:50:09 -07:00
Benjamin Scholtysik (Reimold)
fca531fec9 Update Changelog Template with content from 4.0.2 2016-08-22 14:48:46 -07:00
Benjamin Scholtysik (Reimold)
c14863e62f Version bump in changelog template 2016-08-22 14:38:16 -07:00
Benjamin Scholtysik (Reimold)
083119aa08 Bump version in podfiles 2016-08-22 14:19:06 -07:00
Benjamin Scholtysik (Reimold)
4ec5a6b1fa Rename version to 4.1.0 2016-08-22 14:02:35 -07:00
Michal Ziman
873bae2eed [ASMapNode] Add custom pin annotation for static maps (#1890)
* Adds possibility to have custom annotation pins on static map. This resolves #1889.

* Removes wrong example for map annotations and adds some annotations to correct map example. #1889

* Static map node now uses specific property block to get annotation views.

* Changes self to strongSelf inside of the snapshotters completion block.

* MapNode: Adds statement in documentation.

* MapNode: Block for annotation view/image now returns UIImage and center offset is returned in inout param.

* MapNode and map example: Fixes from review.

* MapNode example: Gets image directly from custom annotation, without creating annotation view.
2016-08-22 10:44:29 -07:00
ricky
c0be871812 [ASViewController] Propagate the traits on willTransitionToTraitCollection (#2115)
Previously we were only propagating the trait collection on `viewWillTransitionToSize` since it is called shortly after `willTransitionToTraitCollection`. However, some important things can happen in that time “shortly after” (like collection view layout). As long as nothing changes from `willTransitionToTraitCollection` to `viewWillTransitionToSize` (which it shouldn’t) the traits will not be re-propagated anyhow.

Also make sure to use the `ASEnvironmentTraitCollectionMakeDefault` method when creating new envTraitCollection so the struct isn’t filled with junk.
2016-08-22 10:06:53 -07:00
Yue-Wang-Google
a38f3db6b0 set the right attributes for block properties. (#2113)
* set the right attributes for block properties.

* oops. should remove strong.

* Update ASImageNode.mm

* revert to use copy for blocks. See apple documentation below

https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/WorkingwithBlocks/WorkingwithBlocks.html#//apple_ref/doc/uid/TP40011210-CH8-SW12

* make the block properties nonatomic.
2016-08-21 13:06:21 -07:00
Yue-Wang-Google
1951954ba5 remove non unicode char (#2109)
see https://github.com/facebook/AsyncDisplayKit/issues/2108
2016-08-19 17:51:41 -07:00
Adlai Holler
69e73065e5 Avoid accessing itemCountsFromDataSource off-main (#2106) 2016-08-19 12:10:19 -07:00
Adlai Holler
fa3a988b54 [ASPagerNode] Rename constrainedSizeForNodeAtIndexPath: to constrainedSizeForNodeAtIndex: for consistency (#2097) 2016-08-19 11:47:56 -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
Peter
ebad7614d1 no message 2016-08-19 16:22:12 +03:00
Peter
d52005a3f2 no message 2016-08-19 16:20:44 +03:00
Peter
e32d035f94 no message 2016-08-19 16:20:23 +03:00
Peter
0eb6029dc9 no message 2016-08-19 16:20:03 +03:00
Peter
7cad465acf no message 2016-08-19 16:19:48 +03:00