50 Commits

Author SHA1 Message Date
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
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
Hannah Troisi
e4abe898d5 [ASEditableTextNode] Support UITextInputTraits pass-through methods (threadsafe for use before view creation) (#1809)
* [ASEditableTextNode] Support UITextInputTraits

* consistent property attributes

* remove logging, fix tests to account for UIKit weirdness

* address @appleguy's comments
2016-06-24 16:53:10 -07:00
Vadim Spivak
eb057ca380 Editable text node should include insets when calculating size 2016-06-17 13:55:32 -07:00
Vadim Spivak
e55037354c Round up editable text node to the next point (#1761)
Rounding up to the next device pixel was calculating a height smaller
than  UITextView's contentSize. This was causing the baseline to move as
the user was typing.
2016-06-16 21:59:29 -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
Michael Schneider
e84f9f27c2 Fix measurement of ASEditableTextNode
- Add ability to measure the ASEditableTextNode based on the content now by calling measure:
- ASEditableTextNode considers preferredFrameSize now
- Fix crash if ASEditableTextNode is included in a horizontal stack
- Add tests for ASEditableTextNode
2016-05-31 16:29:40 -07:00
Aaron Schubert
06d4573b14 [tvOS] Branch out tvOS specific code into it's own categories 2016-04-21 08:59:14 +01:00
appleguy
938437d38f Merge pull request #1455 from ejensen/scrolls-to-top
[ASEditableTextNode] Synchronize scrollsToTop with scrollEnabled
2016-03-31 21:19:45 -07:00
Eric Jensen
a4a0b1f85e Synchronize ASPanningOverriddenUITextView's scrollsToTop when the scrollEnabled property changes 2016-03-29 12:18:57 -07:00
Eric Jensen
0d52176e03 Add an ASEditableTextNode initializer that allows customization of its ASTextKitComponents 2016-03-25 22:23:03 -07:00
Eric Jensen
7de48da44f Correct ASEditableTextNode's default value according to the documentation 2016-03-24 20:00:53 -07:00
Eric Jensen
f988f86f7f Assign the textView's scrollEnabled property in ASEditableTextNode's didLoad method.
This prevents a mismatch if the scrollEnabled property on ASEditableTextNode is set before the textView is loaded.
2016-03-24 19:51:16 -07:00
Eric Jensen
17aebcbaba Add a space between the ? and : in ternarys 2016-03-17 10:38:51 -07:00
Ethan Nagel
26dcad5218 Add a warning if [super layout] is not called (which causes big problems for ASLayout.) 2016-02-24 10:28:22 -08:00
appleguy
ccbf38c72e Merge pull request #1096 from facebook/pr/1059
[tvOS] Initial changes to support building AsyncDisplayKit for tvOS.
2016-01-23 12:28:43 -08:00
Luke Zhao
882379a820 Update comments for ASPanningOverriddenUITextView 2016-01-20 16:33:45 -08:00
Luke Zhao
995f437e12 Allow ASEditableTextNode to scroll 2016-01-19 10:32:19 -08:00
Aaron Schubert
cc4f604ea3 [tvOS] Initial commit to make build run. 2016-01-12 14:43:30 +00:00
Samuel Hsiung
e4ca0e3ccf make ASEditableTextNode's textView clip to bounds 2015-12-11 18:53:10 -08:00
Levi McCallum
a0c05ebffc Rename CK classes to AS classes 2015-11-30 06:44:53 -08:00
Samuel Hsiung
e4d2551384 Make textContainerInset configurable for ASEditableTextNode placeholder and typed textViews
Previously, it was only possible to configure the textContainerInset of the typed textView by accessing the textView property on didLoad. This would cause the placeholder and typed textViews to become desynced however, so in this commit we add the ability to configure both.
2015-10-31 16:37:04 -07:00
Adlai Holler
87caed27e2 Add more deep compares when setting public properties to the same value 2015-10-05 23:48:48 -07:00
rcancro
52091eb589 Placeholder bug in ASEditableTextNode
When setting a default placeholder and an attributedString before `_textKitComponents.textView` was created, the placeholder and the string were both appearing in the text node.

`_updateDisplayingPlaceholder` is called in `setAttributedString`, but since  `_textKitComponents.textView` is nil the placeholder was not hidden. Calling `_updateDisplayingPlaceholder` after `_textKitComponents.textView` loads fixes this.
2015-09-23 16:11:46 -07:00
Adlai Holler
20c74229a9 Updates from PR 2015-09-22 13:16:59 -07:00
Adlai Holler
e9f463da73 Use the right name 2015-09-21 00:16:02 -07:00
Adlai Holler
a1ffa499cb Assert against the user trying to set isLayerBacked on ASEditableTextNode 2015-09-21 00:15:03 -07:00
Adlai Holler
efe198e814 Use ceilSize in ASEditableTextNode 2015-09-20 21:18:06 -07:00
rcancro
2f3562fa09 scott's comments 2015-09-15 09:11:19 -07:00
rcancro
01be5acece added a callback for initWithViewBlock/initWithLayerBlock 2015-09-14 20:36:08 -07:00
appleguy
16ed66c3a1 Merge pull request #550 from marmelroy/issue-549
Access to underlying UITextView for more configuration options.
2015-07-30 22:04:30 -07:00
Connor Montgomery
ca5e9e7dc3 Add support for configuring on ASEditableTextNode. 2015-07-30 15:19:00 -04:00
Roy Marmelstein
6b38000941 A simpler, cleaner implementation 2015-07-22 11:05:27 +02:00
Roy Marmelstein
3c71289927 lazy creation of textview in accessor after assert 2015-07-18 16:31:13 +02:00
Roy Marmelstein
6b970e0e4a Display node assert 2015-07-18 16:29:25 +02:00
Roy Marmelstein
36b92205ed Brace style 2015-07-18 16:10:32 +02:00
Roy Marmelstein
fd3eb94fcb Add main thread warnings and setter/getter assert 2015-07-12 21:35:42 +02:00
Roy Marmelstein
95016021b4 Access to underlying UITextView for more configuration options. 2015-07-09 16:09:20 +02:00
Huy Nguyen
9678adaa93 Merge branch 'master' into layout_node 2015-07-06 22:21:32 +07:00
Huy Nguyen
af64f33ed7 Minor changes: remove unncessary imports and add a new line ad the end of ASInternalHelpers.h 2015-07-01 18:36:36 +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
Jack Flintermann
8a200078bd make ASEditableTextField properly subclass responder methods 2015-06-27 03:19:51 -04: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
abe98d5b09 Integrate new layout nodes to the framework.
- Introduce ASLayoutNode and its subclasses.
- ASDisplayNode measures its ASLayoutNode and cache the result (ASLayout). Calculated size and position of each subnode can be retrieved from the calculated layout.
- Custom nodes need to override -layoutNodeThatFits:(CGSize) instead of -calculateSizeThatFits:(CGSize).
- Custom nodes do not need to layout its subnodes (in -layout:) anymore. ASDisplayNode can handle the job most of the time, by walking through its layout tree.
- ASCompositeNode is used to embed (display) subnodes to a node's layout. That way, each subnode will also be measured while the parent node is measuring. And the parent node knows where its subnodes are within its layout.
2015-06-25 11:34:35 +07:00
Ryan Nystrom
b6715b5cf9 Forward touches to super instead of the superview
fixes #402
2015-03-26 21:11:13 -07:00
Nadine Salter
e0f926c861 Switch ASTextKitComponents interface C -> ObjC. 2015-01-25 16:27:01 -08:00
Nadine Salter
35d7f43fb6 Convert ASTextKitComponents to an object.
ARC doesn't play nicely with structs that contain references to
Objective-C objects, which causes breakage when using AsyncDisplayKit as
a dynamic framework (e.g., with CocoaPods 0.36+).  Fixes #198.
2015-01-25 15:50:54 -08:00
Nadine Salter
795b297c38 ASEditableTextNode. 2015-01-23 15:02:16 -08:00