67 Commits

Author SHA1 Message Date
Michael Schneider
dab3281afa
Don’t handle touches on additional attributed message if passthrough is enabled (#1184)
* Don’t handle touches on additional attributed message if passthrough is enabled

* Cleanup

* Don't handle extra inAdditionalTruncationMessage within pointInside:withEvent:

* Update changelog

* Address comments
2018-10-24 07:49:58 -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
27fac9f586
Create a centralized configuration API (#747)
* Update the dangerfile

* Make a trivial change to test new dangerfile

* Try out the new value with another trivial change

* Add a configuration API to make a unified place for pulling config from clients safely

* Specify properties for delegate

* Finish removing text experiment global enable

* Generate the config file

* Clean up configuration to fix tests

* Work on making it serializable

* Finish it up

* Fix example code

* Update sample project

* Clean up a few things

* Align with new project order

* Make it faster and update license header

* Add an option to specify your config at compile time

* Update another license header

* Add a version field, and bring interface state coalescing into configuration

* Update CA queue code

* Update CATransactionQueue tests

* Turn transaction queue on by default (for now, see comment)

* Update the tests

* Update the tests AGAIN

* Remove unused ordered set
2018-03-25 12:52:57 -07:00
Adlai Holler
d4725a51f2 Add Experimental Text Node Implementation (#259)
* Add experimental text node implementation, based on YYText

* Fix warnings and alert when unimplemented experimental features are used.

* Address feedback from review

* Extend the cthulog

* Update license headers
2017-05-14 12:02:07 -07:00
David Robles
2bc701d23f Copy ASTextNode’s implementation of placeholderImage into ASImageNode in order to fix the usage of placeholderColor. (#2866) 2017-01-05 14:59:11 -08:00
Michael Schneider
4f1d7ec064 Never access the view property of the node in init 2016-11-23 15:50:26 -08:00
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
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
Michael Schneider
d6e5e27c39 [Layout] Add helper properties for setting sizes via CGSize and ASRelativeSize (#2324)
* Remove set layout style size helper

* Update API to set and get a CGSize / ASRelativeSize from an ASLayoutElementStyle

- Expose ASRelativeSize type
- Add new helper properties to set a size / relative size to ASLayoutElementStyle
- Don't expose the size in ASLayoutElementStyle anymore and move into ASLayoutElementStylePrivate

* Update examples

* Update comments for size helpers
2016-10-04 12:35:45 -04:00
Garrett Moon
5205ef6840 [API] Remove old deprecated methods. (#2312)
* Remove old deprecated methods. Will restore ones that were removed recently based on PR.

* Update example to use non-deprecated method.

* Don't remove locking / unlocking, insets or willDisplayNode deprecated methods yet.
2016-10-03 14:57:01 -04:00
Hannah Troisi
b18e1bc071 Fix example projects to use Layout API 2.0 style object (#2285)
* fix examples/ASDKLayoutTransition

* fix examples/ASMapNode to use new Layout API 2.0

* fix examples/SocialAppLayout to use Layout API 2.0

* fix CatDealsCollectionView to use Layout API 2.0

* fix examples/AsyncDisplayKitOverview to use Layout API 2.0

* Kittens Layout API 2.0 fixes

* HorizontalWithinVerticalScrolling

* VerticalWithinHorizontalScrolling

* ASDKTube

* fix ASViewController

* fix layout

* fix layout

* fix size
2016-09-23 16:24:21 -07:00
Michael Schneider
8897614f0e [Layout] Layout API based on content area (#2110)
* Initial commit for adding a size constraint to ASLayoutable's

* Some more commits

* Fix sample projects in extra/

* Remove preferredFrameSize test of ASEditableTextNode

* Remove preferredFrameSize from examples_extra

* Add deprecation warning to -[ASDisplayNode preferredFrameSize]

* Add deprecation warning to -[ASDisplayNode measureWithSizeRange:]

* Commit

* Commit

* Remove ASRelativeSizeRange

* Make ASRelativeSize private

* Adjust examples

* Improve setting of -[ASLayoutable size] with points or fractions

* Add ASWrapperLayoutSpec

* Improve creation of ASRelativeDimension

* Add `preferredFrameSize` back and add deprecated logging

* Add `layoutSpecBlock` setter and getter and add locking for it

* Add better documentation and fix macros to create ASRelativeDimension

* Create new ASSizeRangeMake with just a CGSize as parameter

* Update Kitten and Social App Layout example

* Add layoutThatFits: and deprecate measure:

* Rename ASRelativeDimension to ASDimension

* Fix examples for ASDimension renaming

* Remove fancy height and width setter

* Fix ASDimension helper

* Rename -[ASLayout layoutableObject] to -[ASLayout layoutable]

* Update layout related methods and more clearer documentation around how to use it

* Deprecate old ASLayout class constructors

* Don't unnecessary recalculate layout if constrained or parent size did not change

* Use shared pointer for ASDisplayNodeLayout

* Fix rebase conflicts

* Add documentation and move implementation in mm file of ASDisplayNodeLayout

* Fix test errors

* Rename ASSize to ASLayoutableSize

* Address comments

* Rename setSizeFromCGSize to setSizeWithCGSize

* Improve inline functions in ASDimension

* Fix rebase conflicts
2016-09-07 08:44:48 -07:00
Adlai Holler
5e3627a9cd [ASTextNode] Actually deprecate attributedString property (#2151) 2016-09-01 16:43:03 -07:00
Hannah Troisi
c857e809f4 Clean up header comments (for consistent Facebook licensing info) (#1741)
[Licensing] Clean up header comments (for consistent Facebook licensing info)
2016-06-11 23:31:39 -07:00
Scott Goodson
b99910a149 [Examples, Build] Fix project configuration of two example apps that were incompatible with modern Cocoapods. 2016-04-22 23:04:12 -07:00
Michael Schneider
9291372c7f Show status bar in examples 2016-03-02 06:53:55 -08:00
Adlai Holler
8f10d8ea99 More progress with the Swift example 2016-02-01 12:10:38 -08:00
rcancro
7f6f2fed11 Added ASTextNodeWordKerner support to ASTextNode
* Added a member to `ASTextKitAttributes` that is an optional delegate to the struct's NSLayoutManager.
* Changed ASTextNode to set this delegate to an instance of ASTextNodeWordKerner.
* Updated init method of `ASTextKitContext` to take an optional NSLayoutManager delegate
* Added the files in TextKit folder to the public headers (so we can include ASTextNodeTypes.h)
2016-01-28 08:38:22 -08:00
Luke Parham
a75871055f added video sample app with tableview and simple one with 3 video examples 2015-12-18 02:22:33 -06:00
Levi McCallum
2d93192b9f Fix selection behavior of ASTableView cells 2015-11-11 01:06:28 -08:00
Huy Nguyen
9e4c274a5b Animate relayout in Kittens example 2015-11-04 16:53:36 +02:00
appleguy
0598935957 Merge pull request #793 from nguyenhuy/ImproveCellNodeRelayout
ASCellNode delegate to automatically resize in table & collection when -setNeedsLayout called.
2015-11-01 11:11:32 -08:00
Scott Goodson
3175ce2fe7 Fix retain cycle in basic, cache-less ASNetworkImageNodes
This should not directly affect more complex apps that don't use the ASBasicImageDownloader.

Also disables the default-on text placeholders, as they churn memory during the measurement pass.
These were intended to be written with pure layers (without using backing stores), so I don't
think it is a reasonable default-on behavior until that is fixed.
2015-10-30 22:42:05 -07:00
Huy Nguyen
fb18e7635b Notify ASCellNodeDelegate even if a relayout doesn't result in a resize
If the delegate is an ASTableView, relayoutAnimation will still be considered for animation.
2015-10-29 21:27:29 +02:00
Huy Nguyen
00400e166f Introduce ASCellNodeDelegate
- Cell node automatically notifies the delegate after a relayout (via -setNeedsLayout) that results in a new size. Confirming to ASCellNodeDelegate; ASTableView and ASCollectionView reload the calling cell upon notifications. These views automatically set themselves as delegate of every node.
- The result is that ASCellNode subclasses don't need to manually notify the containing view. Thus, `-relayoutItemAtIndexPath` and `-relayoutRowAtIndexPath` are removed.
- Kittens example is updated to reflect the change.
2015-10-29 16:59:46 +02:00
Huy Nguyen
210a89e83c Animate subnodes swap in Kitten example. 2015-10-12 22:24:19 +03:00
Huy Nguyen
f13f61c2f0 Add relayout item/row APIs to ASTableView and ASCollectionView. 2015-10-07 21:25:07 +03:00
Scott Goodson
47be24037d Reduce _ASAsyncTransaction allocations by ensuring nodes without display methods don't create them. 2015-09-24 19:26:00 -07:00
rcancro
cbaf178950 Hide ASLayoutOptions from the user 2015-09-08 09:50:47 -07:00
rcancro
61b72d2c46 fix kittens example 2015-09-08 09:49:40 -07:00
appleguy
ecfacd0bd7 Merge pull request #621 from nguyenhuy/table_cell_node_min_width
New min constrained width for cell nodes in table view
2015-08-28 23:47:22 -07:00
rcancro
680305704a addressed comments and fixed tests 2015-08-21 21:03:40 -07:00
rcancro
c06a6be188 ASLayoutSpec are temporarily mutable and have a more obj-c interface 2015-08-21 16:02:36 -07:00
Huy Nguyen
641929c4e5 By default, cell nodes in table view should fill its width. So the min constrained width is updated to enforce this behaviour. 2015-08-21 17:43:40 +03:00
Huy Nguyen
7249661990 Improve relayout when constrained size of all nodes is changed:
- In -layoutSubviews of table and collection views, detect changes that cause a different constrained size for nodes, and trigger relayout immediately.
- Orientation change can be handled by this solution. So, no need to observe to its events.
- Update Kittens example to support iPad (easier to catch bugs on these devices) and add a title to navigation bar (looks a bit nicer).
2015-08-13 06:28:47 +03:00
appleguy
57291fa544 Merge pull request #590 from rcancro/master
Add expectedSize to ASNetworkImageNode
2015-08-12 15:51:57 -07:00
ricky cancro
b58e8344c0 Add expectedSize to ASNetworkImageNode
ASNetworkImageNode defers to ASImageNode to return its calculatedSize. ASImageNode returns the size of its image. There is a good chance that ASNetworkImageNode hasn't downloaded its image yet when calculatedSize is called, so it returns a size of CGSizeZero.

On top of that, it is possible that the size of the image is not actually the size that we wish to display in our node.

I've added an "expectedImageSize" property that can be used to determine the calculatedSize of an ASNetworkImageNode.
2015-08-09 16:34:44 -07:00
Huy Nguyen
219b659b38 - Automatically relayout cells when editing mode is used.
- Add editing mode to Kitten sample.
2015-08-09 00:45:54 +03:00
Huy Nguyen
77b586a7e6 Improvements on internal relayout. 2015-08-03 06:25:23 +03:00
Huy Nguyen
56768a837a - Support internal relayout, that is a relayout caused by internal layout changes, like subnodes re-arrangement and/or subnodes' size change. The constrained size applied to root node is unchanged.
- Update Kittens example to show how internal relayout is done.
2015-08-02 17:18:45 +03:00
Huy Nguyen
bbadc9a1e9 Update nodes in Kittens example to use new signature of layoutSpecThatFits:.. 2015-07-10 19:46:32 +07:00
Huy Nguyen
daf3daeb51 Preserve the manual layout code in Kittens example. 2015-07-05 14:36:39 +07:00
Huy Nguyen
33a3412acf Horizontally center the text in Kittens' BlurbNode. 2015-07-05 13:54:47 +07:00
Huy Nguyen
2149d44990 Fix naming convetion:
- "Layout node" is changed to "layout spec".
- Update tests.
- Update Kittens sample.
2015-07-01 18:13:44 +07:00
Huy Nguyen
dd29a890df Still support -calculateLayoutThatFits: (and manual layout), for backward compatibility. 2015-06-28 20:31:32 +07:00
Huy Nguyen
95e787b226 Remove stack children type:
- ASLayoutable requires mutable properties that are used when attached to a stack layout.
- Thus, ASLayoutable objects (including ASDisplayNode) can be injected into stack layout directly.
- ASStackLayoutNodeChild no longer needed.
- Tests and Kitten sample updated.
2015-06-26 11:47:42 +07:00
Huy Nguyen
f588bceb4d Introduce ASLayoutable and eliminate ASCompositeNode:
- Both ASDisplayNode and ASLayoutNode conforms to this protocol.
- ASDisplayNode can be embeded directly into layout graph.
- Eliminate ASCompositeNode.
- Fix ASStaticSizeDisplayNode not recpect min constrained size.
- Updated tests.
2015-06-26 09:29:16 +07:00
Huy Nguyen
697b9f4c3c Update Kittens example to work with the improved layout system. 2015-06-25 11:36:02 +07:00
Huy Nguyen
375f99eb66 Update Kittens sample to use new layout system. 2015-06-25 11:34:36 +07:00
Hannah Troisi
710c51593e Cleaned up Kittens sample app and added comments for clarity.
In particular, the NSValue-boxed CGSize array used as a data model for the kittens
is generated with random sizes, for unclear reasons.  It turns out this is a workaround
to convince PlaceKitten to send us unique images.
2015-06-21 11:36:19 -07:00