462 Commits

Author SHA1 Message Date
Adlai Holler
6e7cdea797
Add extension points for global node behaviors, potentially replacing interface state delegates (#1229)
* Add extension points for global node behaviors via categories and a public ivar

* Update documentation on context ivar
2019-02-14 14:17:03 -08:00
Michael Schneider
231ba3d6b8
Add Yoga layout to ASDKGram Texture cells (#1315)
- Fix Yoga layout within PhotoCellNode
- Add Yoga layout support to FeedHeaderNode and TailLoadingNode
2019-01-18 08:43:51 -08:00
Michael Schneider
5212d022ab
Fix loading items in ASDKGram IGListKit example (#1300) 2019-01-10 08:56:38 +01:00
Michael Schneider
31125ff6cf
Add Video subspec (#1240) 2018-11-21 08:30:22 -08:00
Michael Schneider
aad0b5d18b
Add -Wno-implicit-retain-self to podspec + smaller cleanups (#1209) 2018-11-04 09:34:39 -08:00
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
ernestmama
5e0579308d Rollout ASDeallocQueueV2 #trivial (#1143) 2018-10-01 11:20:12 -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
Michael Schneider
9e2947e7fb
Revert "Optimize drawing code + add examples how to round corners (#996)" (#1055)
This reverts commit eb4c21c54540d2c1c0b63a6b0665a77fea810e6c.
2018-07-31 04:40:18 -07:00
Michael Schneider
eb4c21c545 Optimize drawing code + add examples how to round corners (#996)
* Use CoreGraphics for drawing and cropping of node content

* Smaller fixes
2018-07-26 09:44:10 -07:00
Michael Schneider
c8b5a1b323
Rewrite Swift Example (#1002)
* Rewrite Swift Example

* Add license header to OrderedDictionary
2018-07-08 08:55:28 -07:00
Garrett Moon
9ccba7fe74
Update to unsplash (#938)
* Switch photos from 500px to Unsplash

* Good bye comment view :(

* Update license headers
2018-05-23 20:47:42 -07:00
Adlai Holler
8b890f07be
Create a new dealloc queue that is more efficient (#931)
* Fork dealloc queue in an experiment

* Fix and put back

* Use the right selector

* Go simpler

* Clarify name

* Type inference

* Use CFTypeRefs like a boss

* Improve comments

* License header
2018-05-22 09:06:24 -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
Karthik M
6b57b1cf1a [ASDKGram Example] image_url has been changed from URL to Array by 500px. (#813) 2018-02-27 20:40:45 -08:00
Michael Schneider
5ea4d51596
Get CatDealsCollectionView example running again #trivial (#783)
* Get CatDealsCollectionView example running again

* Fix it for real and some other styling stuff

* Fix some warning

* Adjust headers
2018-02-02 11:41:19 -08:00
Aaron Rosenberger
d6971980a3 Fixed: completeBatchFetching is called on a background thread (#731)
* Fixed breaking issue where completeBatchFetching is called on a background thread when no items are added to the collection

* Changed spaces to tabs for consistency

* Moved return statement for Code Review feedback

* Fixed the same issue in the Objective-C version of ASDKgram

* One more

* Update PhotoFeedModel.m

Fix header
2018-01-31 10:23:04 -05:00
Adlai Holler
fef965f78e
Add support for providing additional info to network image node delegate (#775)
* Add support for piping arbitrary user info from ASImageDownloader to the ASNetworkImageNodeDelegate

* s/source/sourceType

* Fix stuff and take Michael's advice
2018-01-30 17:50:38 -05:00
Adlai Holler
61dade6bda Raise deployment target to iOS 9 (#743)
https://github.com/TextureGroup/Texture/pull/743

Manually merged since I forgot to retarget that diff onto master before merge
2018-01-15 15:13:05 -08:00
Adlai Holler
1d105c2056
Add an experimental "no-copy" renderer (#741)
* Add "ASGraphicsContext" to skip copying our rendered images

* Zero the buffer before making a context

* Update license header

* Update dangerfile

* Make it a runtime flag

* Restore GState for good measure

* Free buffer if end without image

* Enable the experiment, and cut out the middle-man

* Fix typo
2018-01-13 19:19:08 -08:00
Adlai Holler
5e73396cde
Enable collection node interactive moves (#735)
* Add support for interactive moves

* Enable drag & drop in collection view example

* Update changelog

* Change the gating logic to match UIKit

* Add a warning when we prevent interactive movement due to async layout
2018-01-09 14:34:32 -08:00
huang-kun
e4b2c05c21 [ASCornerLayoutSpec] New layout spec class for declarative corner element layout. (#657)
* Add new layout spec class with snapshot testing. Update examples and CHANGELOG.md

* Code review updates.

* Open curly bracket in a new line.
2017-11-24 13:45:59 +00:00
Erwin Zhang
cb2e5ddb2d Fix swift sample. (#669) 2017-11-21 13:33:45 +00:00
Derek Argueta
72d33fc88e Update Pinterest CDN URL in example code (#613) 2017-10-12 12:44:30 +01:00
Garrett Moon
4dbb6441d7 Animated WebP support (#605)
* Updating to support animated WebP

* Fix a deadlock with display link

* Fix playhead issue.

* Fix up timing on iOS 10 and above

* Don't redraw the same frame over and over

* Clear out layer contents if we're an animated GIF on exit range

* Clear out cover image on exit of visible range

* Don't set cover image if we're no longer in display range.

* Don't clear out image if we're not an animated image

* Only set image if we're not already animating

* Get rid of changes to podfile

* Add CHANGELOG entry

* Update license

* Update PINRemoteImage

* Remove commented out lines in example
2017-10-09 11:48:32 -07:00
Hannah Troisi
dcaca529b4 [ASDKgram Example] fix crash on startup (#566)
* fix crash on ASDKgram startup

* quicker fix
2017-09-16 10:36:58 -07:00
Huy Nguyen
d4b1f625aa [Gallery layout] Include the caller in properties providing methods (#533)
* Include the caller in ASCollectionGalleryLayoutPropertiesProviding's methods

* Update CHANGELOG.md
2017-09-08 17:05:06 +01:00
Huy Nguyen
4ba6f451f6 [Cleanup] Remove deprecated APIs (#529)
* Remove preferredFrameSize

* Remove -measure:

* Remove -measureWithSizeRange:

* Remove ASLayoutable

* Remove .name

* Remove deprecated style forwardings

That includes following properties that are declared on ASDisplayNode and ASLayoutSpec: spacingBefore, spacingAfter, flexGrow, flexShrink, flexBasis, alignSelf, ascender, descender, sizeRange and layoutPosition.

* Remove usesImplicitHierarchyManagement

* Remove deprecated range update callbacks:
-visibilityDidChange:
-visibleStateDidChange:
-displayStateDidChange:
-loadStateDidChange:

* Remove -clearFetchedData

* Remove -cancelLayoutTransitionsInProgress

* Remve ASDisplayNode+Deprecated.h

* Remove ASLayoutRangeTypeRender and ASLayoutRangeTypeFetchData

* Remove -[ASTableView clearContents]

* Remove reloadDataImmediately

* Remove ASStaticLayoutSpec

* Remove ASDimensionDeprecated

* Remove optional -pagerNode:constrainedSizeForNodeAtIndex: delegate method in ASPagerDelegate

* Remove suppressesInvalidCollectionUpdateExceptions

* Remove -[ASCollectionViewLayoutInspector initWithCollectionView]

* Remove ASVideoPlayerNode.loadAssetWhenNodeBecomesVisible

* Update CHANGELOG

* Update license of ASLayoutSpecTests.m

* Update examples/PagerNode

* Remove ASEnvironmentTraitCollection

* Remove -ASViewController.nodeConstrainedSize

* More on removing ASLayoutable
2017-09-07 19:25:42 +01:00
Huy Nguyen
afeb25a6b4 [examples/ASCollectionView] Register supplementary kinds (#508) 2017-08-14 16:52:45 +01:00
Max Wang
a929950d2c Fix SIMULATE_WEB_RESPONSE not imported (#450)
* fix SIMULATE_WEB_RESPONSE not imported (Reported in #449).

* changes per review

* Update license of ViewController.m
2017-08-14 16:31:52 +01:00
Huy Nguyen
fdc1f0468c Improvements in ASCollectionGalleryLayoutDelegate (#496)
* Improvements in ASCollectionGalleryLayoutDelegate
- It now can handle section inset, as well as interitem and line spacings
- Other small changes

* Fix build failure and update file licenses

* Update CHANGELOG

* Minor change

* Another assertion on scrollable directions of gallery layout delegate
2017-08-08 19:11:40 +01:00
Huy Nguyen
78c133e44c [ASCollectionLayout] Add ASCollectionGalleryLayoutSizeProviding (#451)
* Add ASCollectionGalleryLayoutSizeProviding
- This allows users to return different sizes based on certain conditions, such as the collection node's bounds or grid constants.
- ASPagerNode will also act as a size provider to ensure all pages have an up-to-date size that is its bounds.

* Update CHANGELOG

* ASPagerNode to use gallery layout delegate if told to
2017-07-18 10:08:12 +00:00
Huy Nguyen
3ccc2f0f15 Introduce ASCollectionGalleryLayoutDelegate (#76)
* Implement ASCollectionGalleryLayoutDelegate
- It arranges items of the same size into a multi-line stack (say photo gallery or pager). It takes advantage of the fact that its items always have a fixed size to measure as few items as possible while still being able to track their positions at all time. This helps reduce startup/reloadData time, as well as memory footprint.
- It then uses a measure range, which also works as a allocate range, to figure out which items to measure ahead of time. And it guarantees that each item is scheduled to measure only once.
- Lastly, ASCollectionLayoutDelegate has some new methods that allow delegates to hook up and stay ahead of layout attributes requests from the backing view. ASCollectionGalleryLayoutDelegate for example uses these methods to ensure elements that have their layout attributes requested are always ready for consumption, and to measure more elements in the background.

* Handle items that span multiple pages and other improvements in gallery delegate

* Minor fixes

* Fix failing tests

* Fix custom collection example

* Implement missing method in gallery layout delegate

* Fix warnings

* Some improvements
- Collection layout delegates must have a crollable directions property.
- Simplify gallery delegate by not storing unmeasured attributes since calling measure on already measured elements should be cache hits and super fast.
- Abstact some code in gallery delegate to ASCollectionLayoutState+Private and _ASCollectionGalleryLayoutItem.
- Other improvements in gallery delegate

* Fix file licenses

* Move measure range logic to ASCollectionLayout

* Track unmeasured elements

* Remove pending layout in ASCollectionLayout

* Get back pending layout because the timing to latch new data is not ideal

* Add ASCollectionLayoutCache

* Fix file licenses

* Fix xcodeproj

* Add async collection layout to examples/ASCollectionView

* Measure method in ASCollectionLayout to be a class method

* Encourage more immutable states
- Make -calculateLayoutWithContext: to be class methods in ASDataControllerLayoutDelegate and ASCollectionLayoutDelegate.
- Add layout delegate class and layout cache to ASCollectionLayoutContext+Private, to be use by ASCollectionLayout only.
- ASDataController no longer allocates all nodes but lets ASCollectionLayout determine.
- Add scrollableDirections to the layout context since it's often needed by the layout pass. Otherwise users have to wrap it in an info object.
- Update built-in layout delegates and CustomCollectionView example.
- Publish ASHashing. It might be helpful for clients that implement custom collection info objects.

* Remove additionalInfo property in ASCollectionLayoutState

* ASCollectionLayoutState to correctly filter unmeasured elements

* Add ASHashing to umbrella header

* Fix file licenses

* Add ASDispatchAsync and use it in ASCollectionLayout

* Improve code comment in ASCollectionLayoutState
2017-07-14 18:50:26 +00:00
Huy Nguyen
5d72a76fb9 Integrate Weaver into ASDKGram (#412)
* Integrate Weaver into ASDKGram

* Update the license of app delegate
2017-07-04 12:20:17 +00:00
Adlai Holler
8ec4b312cf Overhaul our logging, add activity tracing support. (#399)
* Improve the os_log and os_activity integration

* Address feedback from Scott and Huy
2017-07-03 19:03:26 -07:00
appleguy
486410d7d6 [Yoga] Minimize number of nodes that have MeasureFunc set on them. (#369)
This has one important benefit: fixing the stretching behavior of spacer nodes.

In addition, it should help efficiency of Yoga and certainly minimize calls
to layoutThatFits:.

Next up for Yoga is a mostly-red diff, deleting the non-Contiguous code branches.
2017-06-18 18:18:12 -07:00
Andrew Yates
46c4359cc1 Updates ASDKGram to use IGListKit 3.0.0 (#367) 2017-06-17 23:01:54 -07:00
appleguy
55928f343d [Yoga] Rewrite YOGA_TREE_CONTIGUOUS mode with improved behavior and cleaner integration (#343)
* [Yoga] Rewrite YOGA_TREE_CONTIGUOUS mode with support for mixing with ASLayoutSpec.

After experimentation with the ASYogaLayoutSpec (or non-contiguous) approach to
integrating Yoga, test results and feedback from the authors of Yoga have shown
that this approach can't be made completely correct,

There are issues with some of the features required to represent Web-style
flexbox; in particular: padding, margins, and border handling have varience.

This diff is a first step towards a truly correct and elegant implementation of
Yoga integration with Texture. In addition to reducing the footprint of
the integration, which is an explicit goal of work at this stage, these changes
already support improved behavior - including mixing between ASLayoutSpecs
even as subnodes of Yoga layout-driven nodes, in addition to above them. Yoga
may be used for any set of nodes.

Because Yoga usage is limited at this time, it's safe to merge this diff and
further improvements will be refinements in this direction.

* [ASDKgram] Add Yoga layout implementation for PhotoCellNode.

* [Yoga] Final fixes for the upgraded implementation of the Contiguous layout mode.

* [Yoga] Add CHANGELOG.md entry and fix for Yoga rounding to screen scale.

* [Yoga] Minor cleanup to remove old comments and generalize utility methods.
2017-06-14 19:36:13 -07:00
Adlai Holler
83111de0cc Add first-pass view model support to collection node. #trivial (#356)
* Add first-pass view model support for collection node. Much more to come!

* Address issues

* Update the gorram license header

* Dear lord
2017-06-12 16:50:33 -07:00
Dima
caa7e2e2ad [Examples] Fixed crash on SocialAppLayout-Inverted + behaviour comments (#304)
* [Examples] Fixed crash on SocialAppLayout-Inverted + behaviour comments

* [Examples] Update license header in SocialAppLayout-Inverted to the correct format

* [Examples] License header typo fixes
2017-05-24 11:51:59 -07:00
César Estébanez Tascón
e6accc7ea6 [Examples] Fix LayoutSpecExamples and LayoutSpecExamples-Swift: image URLs were still pointing to asyncdisplaykit.org (#275)
* Fix Image URLs in LayoutSpecExamples and LayoutSpecExamples-Swift (they were still pointing to asyncdisplaykit.org)

* Update documentation of ASMapNode example to accurately reflect implemented layout

* Fix headers

* More headers fixing
2017-05-16 19:05:55 +01:00
Michael Schneider
299df0aa8c [Examples] Fix a couple of examples due to API changes recently #trivial (#267)
* Fix ASDKGram example

* Fix some more examples

* Convert Swift example to 3.0

* Fix VerticalWithinHorizontalScrolling

* Fix some headers

* Fix some more API changes

* Remove semicolons
2017-05-15 09:48:45 -07:00
Huy Nguyen
7dd83615c1 [example/CustomCollectionView] Implement MosaicCollectionLayoutDelegate (#28)
* Implement MosaicCollectionLayoutDelegate

* Update licenses

* Address comments

* Fix license
2017-05-14 12:03:22 -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
Michael Schneider
8692428481 [ASDisplayNode] Pass drawParameter in rendering context callbacks (#248)
* Pass drawParameter in rendering context callbacks

* Add changelog

* Fix examples
2017-05-08 14:39:40 -07:00
Garrett Moon
4cbf278e8d Fixes assertion on startup in social app layout example (#233)
* Fixes assertion on startup found when investigating #220

* Update license in header
2017-05-03 19:05:50 -07:00
George
a4ddc072a4 Fix CustomCollectionView-Swift sample (#22)
* Updated copyright notices

* Fixed crash and removed storyboard
2017-05-03 11:04:00 -07:00
Garrett Moon
fe66bc1a8c Hopefully the last example fix. 2017-04-14 09:37:38 -07:00
Garrett Moon
caace4f98b More example fixes 2017-04-14 09:37:38 -07:00
Garrett Moon
3522c81d5e Update examples 2017-04-14 09:37:38 -07:00