112 Commits

Author SHA1 Message Date
Adlai Holler
404795dc02 Remove Support for iOS 7 (#2930)
* Drop support for iOS 7

* Copy reference images

* Update deployment for sample projects

* Update version

* Update "Life Without Cocoapods"
2017-02-01 14:40:37 -08: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
Chris Danford
ecef8edfdd Add locking around setting weakCacheEntry ivar (#2812) 2016-12-21 13:14:14 -05:00
Huy Nguyen
546925b6d6 Lock and unlock __instanceLock__ directly for a Minor perf win in ASImageNode (#2797)
- Suggested by @appleguy in #2778
2016-12-19 12:10:40 -08:00
Huy Nguyen
c0ae709b88 [ASDisplayNode][ASImageNode] Small refactorings (#2778)
* Comment out template code and fix another comment in ASDisplayNode

* Release instance lock a bit sooner and fix indentation in ASImageNode
2016-12-18 20:57:35 -08:00
appleguy
eeb977e145 [ASDisplayNode] Ensure all subclasses are using base class __instanceLock__ and not re-defining their own. (#2754)
* [ASDisplayNode] Ensure all subclasses are using base class __instanceLock__ and not re-defining their own.

This also moves the @package definition of the instance variable to +FrameworkPrivate instead of Internal.h,
because Internal.h should ideally not be used outside of the ASDisplayNode file setup.  This has greatly reduced
the number of imports of Internal.h.

* [ASDisplayNode] Add ASDisplayNode+FrameworkSubclasses.h to share __instanceLock__ definition.
2016-12-12 19:42:41 -08:00
Michael Schneider
0eb882bae5 Some more changes 2016-11-19 06:43:46 -08:00
Michael Schneider
fb92b448e0 [ASDisplayNode] Proper handling of constrainedSize (#2505)
* Check in ASLayout if size is valid for sizing instead of valid for layout

* Return constrainedSize from calculateSizeThatFits:

Remove invalid constrainedSize check within ASNetworkImageNode. Furthermore as ASDisplayNode does not return CGSizeZero anymore we have to give the display nodes we use in tests and are involving a stack spec an intrinsic content size.

* Remove extra constrainedSize handling in ASNetworkImageNode handling

* Change test to use FLT_MAX
2016-10-28 15:39:03 -07:00
Adlai Holler
dbe3b1bd71 Remove block copying (#2438) 2016-10-20 12:53:25 -07:00
Michael Schneider
f574f2c54e [Layout] Further deprecation steps for preferredFrameSize (#2255)
* Deprecate preferredFrameSize

- Remove all support for preferredFrameSize in ASDK
- preferredFrameSize setter calls through and sets the width and height of the node
- preferredFrameSize getter tries to return a CGSize based on the width and height properties otherwise if this is not possible it throws

* Address comments

* Return CGSizeZero for preferredFrameSize unless width and height are ASDimensionUnitPoints

* Better comment for preferredFrameSize and remove lock in calculateSizeThatFits:
2016-09-27 16:07:36 -04:00
Adlai Holler
1e86dcdbe2 [ASDisplayNode] Use kCGBlendModeCopy in a Couple More Places (#2250)
* Use blend mode copy in a couple more places

* Add some tests
2016-09-15 11:56:46 -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
b233122604 Check the image alpha value correctly (#2198) 2016-09-05 21:27:50 -07:00
Adlai Holler
607ec8f4a5 [ASImageNode] Use kCGBlendModeCopy when Possible (#2197)
* [ASImageNode] Use kCGBlendModeCopy when possible

* Make the blend mode logic more readable
2016-09-05 20:52:06 -07:00
Adlai Holler
5e3627a9cd [ASTextNode] Actually deprecate attributedString property (#2151) 2016-09-01 16:43:03 -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
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
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
Hannah Troisi
893e601e81 Convert to type-generic math (#2050)
* [Optimization] Convert to type-generic math

* add std:: prefix in obj-c++ files

* more cleanup

* revert test changes

* convert min and max back to fmin/fmax
2016-08-09 15:31:37 -07:00
David Rodrigues
70574243f7 Prevent API misuse at compile time (#2035)
Using Objective-C attributes, in this case `unavailable`, we can hide
unsupported APIs at compile time instead of detecting and warn about it
at runtime with a set of asserts.
2016-08-04 19:00:46 -07:00
Chris Danford
c09db1cb17 ASImageNode backing store sharing for memory and CPU reduction (#1974) 2016-08-03 13:10:50 -07:00
appleguy
74bf376b2f [ASDisplayNode] Rename _propertyLock to __instanceLock__ to avoid subclass naming collisions. (#1941) 2016-07-16 15:32:13 -07:00
Hannah Troisi
f39c2ce7e3 [ASTextNode, ASImageNode, ASVideoNode] Use ASDisplayNode base class lock for subclass property synchronization (#1877)
* [ASTextNode, ASVideoNode] Use ASDisplayNode base class lock for subclass property synchronization

* fix headers to match master

* address @appleguy, @maicki comments

* import header

* Swap lock in ASNetworkImageNode as well

* remove invalid comment

* more cleanup of locks
2016-07-09 22:08:34 -07:00
appleguy
3b2af7eb6d [Build] Remove Unused Imports across all of AsyncDisplayKit. This uses a feature of AppCode. (#1875)
Details on the tool are here: https://www.jetbrains.com/help/idea/2016.1/optimizing-imports.html
2016-07-09 17:20:59 -07:00
Michael Schneider
e7e2672472 Move imageLock in braces for getting drawing parameters (#1876) 2016-07-09 17:02:05 -07:00
Scott Goodson
f0ff9c108d Merge branch 'master' of git://github.com/kielgillard/AsyncDisplayKit into kielgillard-master 2016-07-09 15:44:31 -07:00
Michael Schneider
b2810edb0f Move dealloc method from ASImageNode+AnimatedImage category to ASImageNode
Having a dealloc method in a category can be very problematic as the superclass dealloc method will not be called in case it exists.
2016-07-08 14:41:47 -07:00
Kiel Gillard
f7b7bcebeb * Make the "Life Without Cocoapods" sample build and run.
* Properly reference headers within implementation files to avoid import cycles and redeclaration warnings.
2016-07-06 16:58:13 +10:00
Michael Schneider
36e48cf340 Remove caching of _drawParameter and use bounds instead of threadSafeBounds 2016-06-21 13:11:38 -07:00
Michael Schneider
74b9b6b49e Use threadSafeBounds instead of bounds to create drawing parameters 2016-06-21 13:11:38 -07:00
Michael Schneider
fc7cff333e Prevent subclassing of ASTextNode and ASImageNode 2016-06-21 13:11:38 -07:00
Michael Schneider
3384297c58 Move drawing parameters in ASTextNode and ASImageNode to structs 2016-06-21 13:11:38 -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
Eric Jensen
fdc57410ee Move the default animated image runloop mode to a constant, and fallback to the constant if the runloop mode is set to nil 2016-06-09 10:53:37 -07:00
Eric Jensen
370e5f1006 Allow configuration of ASImageNode's animation runloop 2016-06-08 10:38:43 -07:00
appleguy
86deec4033 Merge pull request #1665 from hannahmbanana/master
[AsyncDisplayKit+Debug.h] Move hitTestDebug code out of ASControlNode and into debug file
2016-06-01 11:15:44 +07:00
Michael Schneider
73ce8c148a Add comment for setting the backgroundColor in ASImageNode 2016-05-26 10:01:12 -07:00
Michael Schneider
e3e9d36f56 Fix image sometimes appearing with black background or completely disappearing in ASImageNode 2016-05-25 10:07:34 -07:00
Hannah Troisi
37d4c5e475 Fixing a bug in both debug tools (image scaling, tappable area) in which I don't check that the overlay exists before creating it. 2016-05-15 23:28:39 -07:00
Aaron Schubert
b586b9f34b Fix merge conflicts 2016-04-21 09:26:40 +01:00
Aaron Schubert
e2fa2f8192 [tvOS] Address comments on previous PR. 2016-04-21 09:23:47 +01:00
Aaron Schubert
06d4573b14 [tvOS] Branch out tvOS specific code into it's own categories 2016-04-21 08:59:14 +01:00
appleguy
dd4853bf3a Merge pull request #1273 from aaronschubert0/tvOS
[tvOS] Add default focus states to ASControlNode & ASImageNode.
2016-04-20 13:29:31 -07:00
Garrett Moon
0fc39d1ccd Follow up to animated GIF PR 2016-04-19 13:43:41 -07:00
Aaron Schubert
21abe8f899 Fix merge conflicts 2016-04-19 09:02:07 +01:00
appleguy
30a0c471ca Merge pull request #1528 from ejensen/instancetype
[Refactoring] Replace id with instancetype in initializers
2016-04-16 20:53:41 -07:00
Garrett Moon
1b316217ef Downstream ASAnimatedImage 2016-04-13 14:23:02 -07:00
Garrett Moon
beba9031ef Expose public properties properly
Reviewers: rmalik

Reviewed By: rmalik

Differential Revision: https://phabricator.pinadmin.com/D82227
2016-04-13 14:23:02 -07:00
Garrett Moon
3bcbfb149d Add support for animated GIFs
Summary:
Use NSData as key

Add chunking of files

Add support for Animated Images

This adds support for GIF playback in ASDK. It's not currently ready
for merging to public ASDK – for one the GIF decompression may make
more sense in PINRemoteImage.

Removed duration as it wasn't used

Make cover image lazily loaded

Differential Revision: https://phabricator.pinadmin.com/D82033
2016-04-13 14:23:02 -07:00
Eric Jensen
527397ba7e Replace id with instancetype in initializers 2016-04-13 11:20:05 -07:00