3647 Commits

Author SHA1 Message Date
Hannah Troisi
0b7dfcc54d [Examples] 2.0 Collection/Table API updates (#2390)
* update VerticalWithinHorizontal example

* update SocialAppLayout

* update Kittens

* update HorizontalWithinVerticalScrolling

* update AsyncDisplayKitOverview

* update CustomCollectionView

* CatDealsCollectionView

* update Swift

* address @appleguy's comment

* updates for tableNode deselectRowAtIndexPath
2016-10-24 17:14:28 -07:00
Adlai Holler
0d439a43b6 [ASTextNode] Add Fast-Paths For Text Measurement and Drawing (#2392)
* Add test case for TextKit truncation style

* Add fast path for text node measurement with default truncation

* Use fast path more often

* Reverse options order

* Simplify implementation – no functional change

* Share "isScaled" variable

* Intersect with constrained rect

* Add a failing test case for fast-path truncation

* Add some more truncation tests, using slow path as reference image

* Update the tests

* In ASTextKitRenderer, intersect bounds with constrained rect

* Add test case for TextKit truncation style

* Add fast path for text node measurement with default truncation

* Use fast path more often

* Reverse options order

* Simplify implementation – no functional change

* Share "isScaled" variable

* Intersect with constrained rect

* Add a failing test case for fast-path truncation

* Add some more truncation tests, using slow path as reference image

* Update the tests

* In ASTextKitRenderer, intersect bounds with constrained rect

* Use maximumNumberOfLines property in text kit fast path

Add reference images

Disable fast-path for max-one-line case

* Remove unneeded snapshot files
2016-10-24 17:05:59 -07:00
Hannah Troisi
2834ba3490 [ASPagerNode] Fix ASPagerNodeProxy to use collectionNode (#2475)
* Fix ASProxyDelegate to use collectionNode

* fix constrainedSize...issue
2016-10-24 16:10:56 -07:00
Garrett Moon
86a5aece9c Caching scrollable directions is not safe (#2474) 2016-10-24 14:05:03 -07:00
Hannah Troisi
f7b30577b8 Pager Node Should Implement New ASCollectionDataSource/Delegate Methods (#2466) 2016-10-24 10:58:04 -07:00
Michael Schneider
4e580b96dc Add support for multiple children to ASWrapperLayoutSpec (#2469) 2016-10-24 09:59:44 -07:00
Hannah Troisi
97e23776e4 [ASTableNode] expose ASTableView's -visibleNodes (#2449)
* expose ASTableView's -visibleNodes getter at the ASTableNode level

* add safegaurds

* make visibleNodes a read only property for ASTableNode

* make collectionNode .visibleNodes property
2016-10-24 09:42:04 -07:00
george-gw
3638feffd4 Added selection API to ASTableNode and ASCollectionNode (#2453)
* Added selection API to ASTableNode and ASCollectionNode (#2450)

* Updated test case to use collectionNode instead of collectionView for the selection tests.

* Fixed typos.
Added asserts for main thread.
Updated ASCollectionViewTests for multiple selections for nodes.

* Added assigns to the different properties.
2016-10-24 09:30:09 -07:00
romankl
4dca05767b switch snapshot-test-case back to the main repo (#2454)
The latest version (v2.1.4) brought back the deployment target
`s.ios.deployment_target  = '7.0'`.
2016-10-21 17:41:07 -07:00
Garrett Moon
c65c233613 Fix to beta 5 of PINRemoteImage (#2464)
Beta 4 added a PINCache subspec which was required for ASDK. However,
Beta 5 reverted this in an attempt to fix automatically updated versions
of ASDK. So this patch sets the specific version to beta 5 until we're
ready to launch.
2016-10-21 17:26:16 -07:00
Scott Goodson
30a7edf30f [ASLayout] Remove new ASLayoutPrivate.h file and put contents into ASLayoutSpec+Subclasses.h 2016-10-21 13:23:05 -07:00
appleguy
2c6f8b0506 [AsyncDisplayKit 2] Final changes to ease migration of clients to 2.0 APIs. (#2460) 2016-10-21 13:12:13 -07:00
Hannah Troisi
e87ac54138 disable flaky table thrash test (#2458) 2016-10-21 12:43:51 -07:00
Scott Goodson
3a2ca70676 [ASDisplayNode] Simplify / shorten temporary bridged implementation of preferredFrameSize. 2016-10-21 11:21:21 -07:00
Hannah Troisi
15aa784fe8 [ASCollectionNode] add -indexPathsForVisibleNodes (#2451) 2016-10-21 10:19:27 -07:00
Hannah Troisi
9719357901 [ASLayoutElement] Move ASDisplayNode's .name property to ASLayoutElement (renamed to .debugName) (#2395)
* Move ASDisplay .name property to ASLayoutElement

* keep ASDisplayNode.name deprecated

* address @appleguy's comments
2016-10-20 17:27:31 -07:00
Hannah Troisi
0dd170dde4 clean up ASCollectionView example project (#2384) 2016-10-20 17:10:20 -07:00
Hannah Troisi
1fbcefdbd3 [Examples] Refactor ASMapNode (#2383)
* Refactor example & test Layout API

* fix layoutSpecThatFits:

* remove test code

* address @appleguy's comments

* remove project file

* remove workspace

* Fix Uncalled Collection Delegate Methods (#2433)

* Fix batch fetching

* Fix not calling constrainedSizeForItemAtIndexPath:

* Fix constrainedSizeForItemAtIndexPath: not being called

* Add preferredSize as getter to ASLayoutElementStyle (#2427)

* [2.0] add helpful deprecation messages (#2437)

[2.0] add helpful deprecation messages

* fix macro (#2439)

* Macro still needs to be defined even if we're skipping. (#2441)

* Remove block copying (#2438)

* Make flow layout inspector call the new constrainedSize method (#2444)

* Update exception test for new constrainedSize method (#2445)

* Fix asdk again (#2446)

* Man whoever is maintaining PINRemoteImage really needs to get theirselves together!

* Learning from previous mistakes, we should set a specific version on this.

* Refactor example & test Layout API

* fix layoutSpecThatFits:

* remove test code

* address @appleguy's comments

* remove project file

* remove workspace
2016-10-20 17:09:50 -07:00
Garrett Moon
46cf1e3032 Fix asdk again (#2446)
* Man whoever is maintaining PINRemoteImage really needs to get theirselves together!

* Learning from previous mistakes, we should set a specific version on this.
2016-10-20 15:43:32 -07:00
Adlai Holler
41c0781aa9 Update exception test for new constrainedSize method (#2445) 2016-10-20 14:41:11 -07:00
Adlai Holler
d0421195eb Make flow layout inspector call the new constrainedSize method (#2444) 2016-10-20 14:32:01 -07:00
Adlai Holler
dbe3b1bd71 Remove block copying (#2438) 2016-10-20 12:53:25 -07:00
Garrett Moon
4816d75fbd Macro still needs to be defined even if we're skipping. (#2441) 2016-10-19 16:31:26 -07:00
Hannah Troisi
a705ed09cb fix macro (#2439) 2016-10-19 16:05:54 -07:00
Hannah Troisi
84d1a637d7 [2.0] add helpful deprecation messages (#2437)
[2.0] add helpful deprecation messages
2016-10-19 14:48:06 -07:00
Michael Schneider
4b914f8e15 Add preferredSize as getter to ASLayoutElementStyle (#2427) 2016-10-19 12:55:19 -07:00
Adlai Holler
67489492ee Fix Uncalled Collection Delegate Methods (#2433)
* Fix batch fetching

* Fix not calling constrainedSizeForItemAtIndexPath:

* Fix constrainedSizeForItemAtIndexPath: not being called
2016-10-19 11:49:49 -07:00
Adlai Holler
d32bf3f297 Conditionally import signpost header to fix Xcode 7 build (#2432) 2016-10-19 10:45:58 -07:00
Michael Schneider
abd80494c7 [ASLayoutElementStyle] ASLayoutElementStyle improvements (#2413)
* Use std::atomic for properties in ASLayoutElementStyle

* Remove setter calls for min / max width and height in ASLayoutElementStyle
2016-10-18 15:55:55 -07:00
Michael Schneider
56d50e6d5e Add ASAbsoluteLayoutSpecSizing (#2394)
Add ability for ASAbsoluteLayoutSpec to grow as far as possible or shrink to fit it's children
2016-10-18 13:55:13 -07:00
Michael Schneider
6fcbf642c9 Remove all 3x snapshot test images (#2417) 2016-10-18 13:12:24 -07:00
Michael Schneider
ba80b83695 [ASRelativeLayoutSpec] Fix ASRelatativeLayoutSpec behavior for ASRelativeLayoutSpecPositionStart (#2393)
* Fix ASRelatativeLayoutSpec behavior for ASRelativeLayoutSpecPositionStart

* Add updated images for snapshot tests
2016-10-18 12:00:01 -07:00
Adlai Holler
5a8d0037ec Add wait method to ASCollectionNode (#2416) 2016-10-18 11:00:09 -07:00
Samuel Hsiung
17dcd5f7ec [ASTableNode] Add missing ASTableNode delegate flag setup (#2415)
* add missing ASTableNode delegate flag setup

* fix typo
2016-10-18 10:54:46 -07:00
Adlai Holler
6e76daf279 [Layout] Check Layout Spec Tree for Duplicated Elements (#2408)
* Check layout spec tree for duplicated elements

* Enable layout spec tree dedupe only in debug
2016-10-18 09:33:37 -07:00
Michael Schneider
9f1643ebfd Final size should always be in constrainedSize in ratio spec (#2403) 2016-10-18 09:18:40 -07:00
appleguy
dec9e4e836 [ASDeallocQueue] Fix teardown of thread (doesn't currently happen due to singleton). (#2410)
Although this didn't occur _currently_, the code was incorrect and needs to be fixed.
2016-10-18 09:07:29 -07:00
Michael Schneider
d407663e3f [ASLayout] Improve ASLayout (#2404)
* Add internal header for ASLayout and change position to readonly publicly

* Don't copy sublayouts during tree filtering

* Revert "Don't copy sublayouts during tree filtering"

This reverts commit 6b0d54d5ffe5bb3941ec13696c9c45b0098b6ba1.
2016-10-18 08:36:38 -07:00
Garrett Moon
093653b507 Upgrades to the latest PINRemoteImage (#2414) 2016-10-18 08:35:25 -07:00
appleguy
0a5c1f43a8 [ASRunLoopQueue - Performance] Add ASDeallocQueue for efficient object teardown. (#2399)
* [ASRunLoopQueue - Performance] Add ASDeallocQueue for efficient object teardown.

This measurably reduces block overhead and context switching.  In the layout benchmark,
it increases ops/s while actually reducing CPU utilization.  This suggests that we are
now at a lock-bounded local maximum, at least for tri-core devices.

* [ASDeallocQueue] Update convenience helper method and adopt in ASImageNode etc.

* [ASDeallocQueue] Reimplement the queue using a timer-based runloop.

* [Debugging] Re-enable ASDisplayNode Event Log.

* [ASDeallocQueue] Final refinements, comments, code minimization.

* [ASDeallocQueue] Fix for lock release needed in early return (refactoring typo from last commit)
2016-10-17 12:24:11 -07:00
appleguy
11293d545a [ASLayout - Performance] Avoid weak ivar access & method call to check layoutElementType. (#2397)
* [ASLayout - Performance] Avoid weak ivar access & method call to check layoutElementType.

This shows up in benchmarking profiles for layout-bound workloads.

* Add comment
2016-10-17 12:23:45 -07:00
Adlai Holler
925e343e32 Make ASNetworkImageNode test wait (#2406) 2016-10-17 11:28:48 -07:00
Michael Schneider
ae9e128214 Layout inspector instance variable should be weak in ASCollectionView (#2405) 2016-10-17 10:51:54 -07:00
Hannah Troisi
902bb0999d remove miscellaneous true values (#2391)
[Code Cleanup] Replace `true` values with `YES`
2016-10-15 18:28:46 -07:00
Adlai Holler
0ed8ecb677 Test and improve the ASNetworkImageNode progress block handling (#2386) 2016-10-15 17:50:16 -07:00
Hannah Troisi
3c995d8d12 [Examples] Layout 2.0 updates (#2382)
[Examples] Layout 2.0 updates: Switch YES to 1.0 for flexGrow and flexShrink
2016-10-15 17:30:48 -07:00
appleguy
42d1c9a55b [ASCellNode] Add subclass method cache; skip visibility rect calculations in the common case. (#2388)
Profiling showed this area as the most expensive part of ASRangeController propogation of .interfaceState,
when scrolling an ASTableView.  This is very much on the critical path for sustained 60FPS in these views.
2016-10-15 09:58:57 -07:00
Adlai Holler
c2ea7cfeac [Umbrella] ASCollectionView -> ASCollectionNode Migration, Separate Index Spaces (#2372)
* Separate dataSource & UIKit index spaces

Beef up our supplementary node support

Make the API way better

Go nuts

Add a unit test for UICollectionView's handling of reloadData inside batch updates

Wrap indexPathForNode: in a cache

Convert index paths in delegate methods

Go back on table view

Put collection view back

Switch up the API

Move most ASCollectionView API to ASCollectionNode

Move most table logic over to ASTableNode

Do the things

More conversion work

Keep on keepin' on

Get table view delegate API done

More porting

Simplify

Clear the delegate

More cleanup

Move more stuff around

Remove pointless file

Re-add some API

Put back more API

Use the right flag

* Some cleanup

* Remove incorrect comment

* Tweak the API

* Put back a couple methods

* update example projects (note: ASCollectionView deprecation warnings expected)

* change reloadDataWithCompletion:nil --> reloadData

* Clean up rebase

* Make deprecated numberOfItemsInSection methods optional

* Use the right flag

* Address nits

* update ASDKTube, ASDKgram & ASViewController examples
2016-10-14 17:21:16 -07:00
Adlai Holler
fb768683bc Fix test method name (#2380) 2016-10-14 09:58:32 -07:00
Garrett Moon
1d28639301 [ASCollectionNode] Add scrollableDirections method to ASCollectionViewLayoutInspecting p… (#2381)
* Add scrollableDirections method to ASCollectionViewLayoutInspecting protocol

ASViewController's default method will not always return the correct scrollable
directions in cases where size changes may not have been applied. This allows
us to ignore this issue for a little while longer by allowing the layout
inspector to explicitly vend this.

* Better header, thanks @maicki!
2016-10-14 09:39:28 -07:00