2133 Commits

Author SHA1 Message Date
appleguy
0bc60605e5 Merge pull request #1348 from eanagel/fix-collection-hang
[ASCollectionView] Ensure that we use the correct default size for collection nodes when constrainedSize delegate method not implemented.
2016-03-09 16:41:51 -08:00
rcancro
bcb1832fcd Fixed some text shrinking issues
Previously I was multiplying the calculated height of the text by the scale factor. This fails in the case where we have a long string that doesn't fit, but it is shrunk so much that it now has more than enough room in the renderer's constrained size. In this case we fail to update the calculated size's width.

Also updated `lineCountForString` in `ASTextKitFontSizeAdjuster` to reuse a sizer layout manager and text container.
2016-03-09 15:27:33 -08:00
Michael Schneider
13207dc2da Change memory notification method name 2016-03-09 14:53:37 -08:00
Michael Schneider
bf822dee37 Add ASLayoutRangeModeLowMemory 2016-03-09 14:40:40 -08:00
Eric Jensen
9d4c53b0fa Replace usage of deprecated NSControlCharacterAction value 2016-03-09 11:44:13 -08:00
Levi McCallum
52391dcc27 Change method name in implementation 2016-03-09 10:42:56 -08:00
Levi McCallum
a07f7b73f0 Change method name in header 2016-03-09 10:42:35 -08:00
Levi McCallum
d4a0c34d86 Add ASSizeRangeMakeWithExactCGSize method 2016-03-09 10:39:46 -08:00
Levi McCallum
167b7d404e Add header for extern ASSizeRangeMakeWithExactCGSize 2016-03-09 10:38:25 -08:00
Ethan Nagel
352247184a Ensure that we use the correct default size for collection nodes even if layoutSubviews has not been called yet. This is a more conservative approach than the previous one. 2016-03-09 09:56:32 -08:00
Tom King
a22278340f fixed indentation 2016-03-09 10:27:38 -05:00
Aaron Schubert
71eb9582fb [ASTextNode] Fix default ellipsis not showing for line breaks 2016-03-09 15:10:26 +00:00
Tom King
cd85389397 support the combined [.Selected, .Highlighted] state in ASButtonNode 2016-03-09 09:23:15 -05:00
appleguy
de4e4db671 Merge pull request #1340 from ejensen/documentation-corrections
[Documentation] Various header documentation corrections and refinements.
2016-03-09 02:52:48 -08:00
appleguy
1ce3834e0e Merge pull request #1343 from rcancro/cacheFontScale
[ASTextNode] Improvements to the implementation of the font scale adjuster.
2016-03-09 02:41:13 -08:00
appleguy
112489927e Merge pull request #1338 from tomizimobile/truncationTokenFix
[ASTextNode] Fix tapping on truncation token for 3D Touch phones
2016-03-09 02:16:45 -08:00
Hannah Troisi
51eccb3d96 [ASImageNode] More refined naming and documentation for [ASImageNode shouldShowImageScalingOverlay] 2016-03-08 23:30:17 -08:00
Hannah Troisi
fbe72a06e4 [ASImageNode] A ASImageNode debug feature showing pixel scaling amount
- shows a red text label overlay on bottom right hand corner of ASImageNodes with pixel scaling factor
- import AsyncDisplayKit+Debug.h and enable using [ASImageNode setEnableImageDebugOverlay]
2016-03-08 23:15:07 -08:00
Hannah Troisi
d64c05a68e [ASImageNode] A ASImageNode debug feature showing pixel scaling amount
- shows a red text label overlay on bottom right hand corner of ASImageNodes with pixel scaling factor
- import AsyncDisplayKit+Debug.h and enable using [ASImageNode setEnableImageDebugOverlay]
2016-03-08 23:13:32 -08:00
Scott Goodson
06ea9461cb [ASScrollDirection] Fix tests to use the more intuitive naming for scroll directions. 2016-03-08 22:48:02 -08:00
Ethan Nagel
5a3dab5610 Ensure that er use the correct default size for collection nodes even if layoutSubviews has not been called yet 2016-03-08 17:03:55 -08:00
rcancro
06a6bd6606 fix typo and kick off build again. 2016-03-08 16:32:24 -08:00
rcancro
3ebdf5928c Made a few changes to font scale adjustment
1) cache the scale in the font adjuster. The adjuster will be dealloc'ed when the renderer that owns it is dealloc'ed (or invalidated). Until that time we can trust the scale that the adjuster has computed.
2) When measuring line count, make sure that we are not bounding the height of the container's size. This will cause the wrong number of lines to be returned.
3) Instead of setting the ascender/descender on an ASTextNode when an attributed string is added, wait until after the renderer calculates size. This way, if there is any need to scale the font to fit we can apply that scale to the ascender/descender.
2016-03-08 12:05:26 -08:00
Eric Jensen
c2f85397ce Mark depreciated protocols with deprivation attribute 2016-03-08 11:56:58 -08:00
Eric Jensen
84357c4a48 Correct a couple more documentation comments 2016-03-08 11:56:58 -08:00
Eric Jensen
3d34c177ed Flatten indentation of parameter hierarchy 2016-03-08 11:56:58 -08:00
Eric Jensen
86ccd33a84 Correct a few documentation comments for method parameters 2016-03-08 11:56:58 -08:00
Tom King
1457e97c59 create local variables for performance and clarity 2016-03-08 08:54:07 -05:00
Scott Goodson
5c28bb8e21 [ASScrollDirection] Ensure definitions of "positive" scroll direction in batch context match the layout controller. 2016-03-08 00:53:06 -08:00
Gareth Reese
f7ff8b4173 Updated tests to cover the new API and repeated all of the test logic for URL initialisation to ensure that the functionality is the same 2016-03-08 08:30:13 +00:00
appleguy
6b74ad75a1 Merge pull request #1341 from rahul-malik/rmalik-run-loop-queue
[ASRunLoopQueue] Refactor the run loop implementation code into a reusable queue abstraction.
2016-03-07 23:53:07 -08:00
Rahul Malik
f388180a1d Refactor the run loop implementation code into a proper queue abstraction.
ASRunLoopQueue can process a specified number of items per run loop iteration
via a block based api.
2016-03-07 23:49:50 -08:00
Scott Goodson
9c0d0542dd [ASScrollDirection] Fix scroll direction interpretation after recent changes to this logic. 2016-03-07 22:50:48 -08:00
Scott Goodson
39f5686982 Revert "[_ASAsyncTransaction] Reduce locking overhead by removing C++ stack-allocated MutexLocker objects."
Locking was not quite right here in a certain case where the transaction leaves after other references
were removed.  Will restore this optimization in the future with more time to analyze.

This reverts commit ee524f497d0692a2c0c6ea39bd3840183a00f3ed.
2016-03-07 14:46:06 -08:00
Tom King
f4d5791717 in ASTextNode, bail from touchesMoved:withEvent: if the previousLocationInView is the same as the locationInView. On 3D Touch enabled phones, this gets fired with chages in force, and will usually get fired immediately after touchedBegan:withEvent, causing touches to usually be cancelled 2016-03-07 17:15:30 -05:00
Scott Goodson
9e72679ffd [ASDataController] Swap order of section / item in optimized indexpath creation from yesterday :). 2016-03-07 12:08:31 -08:00
Rahul Malik
5af8b78d78 Transfer node ownership from renderQueue to displayingNodes queue before removing
the node from the renderQueue.
2016-03-07 11:30:23 -08:00
Rahul Malik
62a39c49ea Break up scheduling of node rendering across various run loops 2016-03-06 12:33:31 -08:00
appleguy
e56c3b03f2 Merge pull request #1332 from facebook/ASDataReload
[ASDataController] If app code issues edit commands before first reload, ignore them, as UIKit will call -reloadData.
2016-03-05 23:00:12 -08:00
Scott Goodson
8cfd951f42 [ASDataController] If app code issues edit commands before first reload, ignore them, as UIKit will call -reloadData. 2016-03-05 21:21:22 -08:00
appleguy
4c834685c8 Merge pull request #1329 from hannahmbanana/debugFeatures
[ASControlNode] A debug feature on ASControlNode to visualize tap-able areas
2016-03-05 20:52:25 -08:00
Scott Goodson
c4f6c9035b [ASDataController] If app code issues edit commands before first reload, ignore them, as UIKit will call -reloadData. 2016-03-05 20:52:00 -08:00
Scott Goodson
6a32e5ccc0 [ASDataController] If app code issues edit commands before first reload, ignore them, as UIKit will call -reloadData. 2016-03-05 20:27:36 -08:00
Scott Goodson
cc7ca4a08f [ASDataController] If app code issues edit commands before first reload, ignore them, as UIKit will call -reloadData. 2016-03-05 20:22:18 -08:00
appleguy
354ccf3e5f Merge pull request #1327 from samhsiung/fix_scrollable_directions
[ASCollectionView] scrollableDirections must account for alwaysBounce(Vertical | Horizontal)
2016-03-05 16:35:48 -08:00
Hannah Troisi
9d5fed280d A debug feature on ASControlNode to visualize tap-able areas (by adding a highlight overlay ASDisplayNode as a subnode) when addTarget:action:ControlEvent: is called. Uses hitTestSlop to get ASControlNode's UIEdgeInset and set the highlight overlay's frame to be the ASControlNode frame + edge insets. Disables clip to bounds on ASControlNode. Enabled by calling +[ASControlNode setEnableHitTestDebug:YES]; 2016-03-05 16:08:55 -08:00
Luke Zhao
03e84e20ac updated with deprecated message 2016-03-05 13:04:20 -08:00
Samuel Hsiung
85394f09b4 Account for alwaysBounce(Vertical|Horizontal) when calculating scrollable directions 2016-03-04 21:33:08 -08:00
Michael Schneider
15a789c719 Fix content inset problems if ASViewControllers root node has usesImplicitHierarchyManagement set to YES
There are content inset problems if a ASViewController is initialized with a root node (e.g a ASCollectionNode subclass) that has usesImplicitHierarchyManagement set to YES. The reason for that is that the subviews (e.g. the UICollectionView) of the ASViewController root node get's added to the view hierarchy in measureWithSizeRange: in ASDisplayNode.  measureWithSizeRange: of the root node is called in -viewWillLayoutSubviews in ASViewController. That is too late, so UIKit does not apply the automatic content inset to the UICollectionView anymore.
2016-03-04 19:22:09 -08:00
appleguy
0a76c7b5d2 Merge pull request #1301 from lkzhao/collectionView-sectionInset-fix
Remove cell constrainedSize adjustment with section insets in constrainedSizeForNode
2016-03-04 14:26:55 -08:00