2133 Commits

Author SHA1 Message Date
Michael Schneider
01fed69b26 Adds trampoline for inserting and deletion of nodes
Currently measurement always needs to happen on the main thread if implicit hierarchy management is enabled as adding and removing from nodes needs to happen on the main thread. We now will trampoline to the main thread to do the insertion and deletion of nodes.

This also resolves the issue that can occur if a node is already loaded deep in the layout hierarchy in the layout that the node is transforming to. Before insertion or deletion is happening we need to crawl the layout hierarchy to check that though.
2016-07-01 16:33:37 -07:00
Adlai Holler
a77a6eaaf5 Merge pull request #1820 from gazreese/ASCollectionView-tuning-parameters
[ASCollectionView] Tuning parameters not set
2016-07-01 15:09:01 -07:00
Adlai Holler
988098be26 Merge pull request #1837 from gazreese/ASVideoPlayerNode-placeholder-image
[ASVideoPlayerNode] Expose placeholder image for the underlying ASVideoNode
2016-07-01 14:50:29 -07:00
Adlai Holler
3814f42074 Merge pull request #1838 from levi/patch-18
[ASPagerNode] Add nodeForPageAtIndex:
2016-07-01 14:21:35 -07:00
Adlai Holler
96fb5b3261 Merge pull request #1786 from maicki/FixPlaceholderIsNotAppearing
[ASDisplayNode] Handle placeholder layer creation in case the size of the node changes after the initial placeholder layer was created
2016-07-01 13:54:01 -07:00
Adlai Holler
d8efa54f21 Merge pull request #1806 from maicki/MSAddASButtonNodePreferredFrameSize
[ASButtonNode] Add support for 'preferredFrameSize' to ASButtonNode
2016-07-01 13:50:33 -07:00
Adlai Holler
ebaa2c157e Remove aggregate CGRect initializers in ASDataController 2016-07-01 11:47:05 -07:00
Levi McCallum
53bc126ae5 Add implementation of nodeForPageAtIndex: 2016-07-01 09:42:39 -07:00
Levi McCallum
b1ceab7a61 Add nodeForPageAtIndex: to header and clean up doc 2016-07-01 09:39:36 -07:00
Gareth Reese
0a5f03e8fc Merge master into ASVideoPlayerNode-placeholder-image 2016-07-01 15:33:00 +01:00
Gareth Reese
09a344b669 [ASVideoPlayerNode] Expose the placeholder image for the video player node 2016-07-01 15:15:10 +01:00
ricky
8c3025bb12 [ASDisplayNode] added asyncTraitCollectionDidChange method (#1831)
Subclasses can override this method to react to a trait collection change
2016-06-30 19:45:29 -07:00
Michael Schneider
8804342a98 Don't propagate trait collections to cells if the node is not loaded yet (#1833)
This fixes an issue where the propagation of trait collections trigger are creation of the node if the node view was not loaded yet.
2016-06-30 19:44:40 -07:00
Michael Schneider
53f22da1dc Code style improvements 2016-06-30 07:30:57 -07:00
Michael Schneider
d1b4e07d0f Add support for 'preferredFrameSize' to ASButtonNode 2016-06-30 07:30:57 -07:00
Michael Schneider
5f7cdbd9ca Handle placeholder layer creation in case the size of the node changed after the initial placeholder layer was created 2016-06-30 07:30:17 -07:00
Michael Schneider
f0e96cc808 Change @import to #import 2016-06-30 07:18:30 -07:00
Adlai Holler
284160b07b Merge pull request #1821 from maicki/MSAddConformsToProtocolToProxy
[ASDelegateProxy] Add `conformsToProtocol:`
2016-06-29 09:18:14 -07:00
Adlai Holler
45ef91171d [ASTextNode] Release Lock Sooner in -setAttributedText: (#1828)
* [ASTextNode] Release lock sooner in -setAttributedText:

* [ASTextNode] Expand the critical scope a bit
2016-06-28 20:18:30 -07:00
Gareth Reese
1d356242fd [ASVideoNode] Ensure that observer methods don't observer all other ASVideoNode objects 2016-06-28 15:41:26 +01:00
Adlai Holler
d82e1ce95b Merge pull request #1812 from facebook/AHUpdateIntegrity
[ASDataController] Improve Update Handling, Esp. Reloading Sections
2016-06-27 18:11:11 -07:00
Michael Schneider
4091d70003 Add conformsToProtocol: to ASDelegateProxy 2016-06-27 06:38:42 -07:00
Gareth Reese
d55621c285 [ASCollectionView] Tuning parameters not set 2016-06-27 14:07:00 +01:00
Hannah Troisi
db04f4b851 [ASTableView] Add constrainedSizeForRowAtIndexPath: to control row heights from delegate (#1769)
* [ASTableView] constrainedSizeForRowAtIndexPath

* Quick fix to header file

* Switch to Delegate from DataSource.

* Update testing variables to reflect switch to delegate
2016-06-26 23:09:53 -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
Michael Schneider
3fb0e18504 [ASTextNode] Further locking improvements for ASTextNode (#1813)
* Further locking improvements for ASTextNode

* Remove tighter holding of lock as this operation needs to complete with the lock held
2016-06-24 16:49:05 -07:00
Adlai Holler
0a354f8f4e [ASDataController] Remove implementation for unused hooks 2016-06-24 15:48:23 -07:00
Adlai Holler
211dcdf0e8 [_ASHierarchyChangeSet] Remove unused new method 2016-06-24 13:56:08 -07:00
Adlai Holler
0a525a3c16 [ASFlowLayoutController] Fix enumeration bug in ASFlowLayoutController 2016-06-24 13:52:16 -07:00
Adlai Holler
27dc52c0c5 [ASHierarchyChangeSet] Document reload-splitting behavior 2016-06-24 13:20:06 -07:00
Adlai Holler
304f8f6cb1 [ASHierarchyChangeSet] Clean up and add documentation 2016-06-24 13:17:00 -07:00
Adlai Holler
84e8b2686c [ASDataController] Combine isolated reloads into a batch 2016-06-24 13:03:51 -07:00
Adlai Holler
d8d2524b89 One more critical update integrity fix 2016-06-24 11:12:37 -07:00
Adlai Holler
681876bd59 Fix more issues with data integrity 2016-06-24 11:12:37 -07:00
Adlai Holler
9c70cec8d8 Improve update handling more 2016-06-24 11:12:37 -07:00
Adlai Holler
35056f708b [ASDataController] Improve update handling 2016-06-24 11:12:37 -07:00
Adlai Holler
71d9f64535 Carry over first-pass change set improvements 2016-06-24 11:12:37 -07:00
Adlai Holler
77f24231b3 [Documentation] Add a comment why we prefer -indexPathForItem:inSection: 2016-06-24 10:13:51 -07:00
Adlai Holler
457e08005f [ASDataController] Remove asyncDataFetching Option, Cleanup (#1794)
* [ASDataController] Add some assertions to clarify what queues things happen on

* [ASCollectionDataController] Optimize willReloadData

* [ASDataController] Minor optimizations, no functional changes

* [ASDataController] Always reload data on _editingTransactionQueue

* [ASDataController] Remove async data fetching option, deprecate callbacks

* [ASDataController] Not mutable

* [ASMultidimensionalArrayUtils] Use fast enumeration

* Optimize ASMultidimensionalArrayUtils
2016-06-23 21:08:44 -07:00
ricky
997d37dc83 [ASEnvironment] Don't relayout as a result of clearing a traitCollection's context (#1759)
* Don't relayout as a result of clearing a traitCollection's context

I'm not completely sure this change is the best solution. Here is context:

An ASEnvironmentTraitCollection has a pointer to an optional context that an ASVC is the owner of. When the ASVC is dealloc'ed, we go through all subnodes of the VC and clear out the context so that the struct isn't holding on to a garbage pointer.

Setting the traitCollection on ASCollectionNode/ASTableNode causes the cells to relayout if the trait collection changed (this is  a special case for these two nodes since their cells are not actually subnodes). Setting the context to nil registered as a trait collection change and was causing a layout even as we were dealloc'ing the VC.

The logic I'm implementing here is:
If the trait collection changed AND the displayContext did not, then we should relayout.
If the trait collection changed AND the new displayContext is non-nil then we should layout
In the case where the trait collection change was caused soley by the displayContext going from non-nil to nil, then we should NOT layout.

```
// At this point we know that the two traits collections are NOT equal for some reason
BOOL needsLayout = (oldTraits.displayContext == currentTraits.displayContext) || currentTraits.displayContext != nil;
```

Is there a better place/safer way to do this?

* removed extra setNeedsLayout call
2016-06-23 20:07:45 -07:00
Michael Schneider
f0bfa24fa3 Merge pull request #1766 from hannahmbanana/collectionLayout
[ASCollectionView, ASCellNode] Add support applyLayoutAttributes: on ASCellNode
2016-06-23 15:09:10 -07:00
Michael Schneider
2375e31033 Merge pull request #1721 from rcancro/layoutSpec
[ASLayoutSpec] Remove use of dictionary to hold children
2016-06-23 15:07:08 -07:00
Adlai Holler
57310a6fe4 Merge pull request #1802 from facebook/AHThrashTesting
[Unit Tests] Add Table View Data Thrash Testing
2016-06-22 21:35:58 -07:00
Michael Schneider
4f61b6e1cc Merge pull request #1777 from maicki/StructsForDrawingParameter
[ASTextNode / ASImageNode] Use structs for drawing parameter
2016-06-22 20:48:58 -07:00
Michael Schneider
95b03472f2 Merge pull request #1785 from facebook/AHWillDisplayCellDeprecate
[ASCollectionView/ASTableView] Warn Users About Index Paths in willDisplayNode:/didEndDisplayingNode: Methods
2016-06-22 20:47:43 -07:00
Michael Schneider
7175afba59 Merge pull request #1790 from gazreese/ASVideoNode-delegate-superclass
[ASVideoNode] Ensure that both ASVideoNode and ASNetworkImageNode delegate methods are called
2016-06-22 20:43:49 -07:00
John Engelhart
ea64d7d09b Pr/fix unit tests memory leaks (#1795)
* Fix some concurrency problems detected by Xcode 8's new Thread Sanitizer.

Some of these changes are arguably just to silence the warnings from Thread Sanitizer.

* Fix several memory leaks in the unit tests.

A number of the unit test source files are compield with `-fno-objc-arc`.  This was clearly overlooked when writing several of the unit tests.

Fixed by (mostly) switching to use of `-autorelease` for the problem code.

NOTE: This commit doesn't fix all the memory leaks found.  There's still at least one leak in `-[ASDisplayNodeTests testSetNeedsDataFetchImmediateState]`, and several leaks in `ASBasicImageDownloader.mm`.  I wasn't able to find a trivial cause to these, unfortunately.
2016-06-22 16:56:53 -07:00
Nick Velloff
a05d3119ad [WIP] Trigger new batch fetch for collection view after layout transitions (#1697)
[Table / Collection] Trigger new batch fetch after programmatic scrolls, or layout transitions.
2016-06-22 16:21:10 -07:00
Hannah Troisi
d547372a63 [Carthage] define PIN_REMOTE_IMAGE in .pch for non-CocoaPod users (#1797)
* [Carthage] define  PIN_REMOTE_IMAGE in PCH

* fixed ClassString
2016-06-22 15:37:00 -07:00
Adlai Holler
fcf2db79f8 [ASTableViewThrashTests] Initial commit 2016-06-21 18:46:08 -07:00