164 Commits

Author SHA1 Message Date
Kasper Weibel Nielsen-Refs
786ac15e15 [Yoga] Refer to proper path name and use module import (#306)
* Change header path to fix https://github.com/TextureGroup/Texture/issues/25

* Use module import

* Update ASDisplayNode+Beta.h
2017-06-06 17:11:36 -07:00
Hannah Troisi
9ca01b2beb [ASCollectionView] synchronous mode (#332)
* [ASCollectionView] synchronous mode

* add to changelog

* Update ASDataController.mm

* Update ASCollectionNode.mm
2017-06-06 14:55:00 -07:00
appleguy
00013aadab [ASDisplayNode+Layout] Add check for orphaned nodes after layout transition to clean up. (#336)
It is rare that this code has any effect, but I've discovered a case in which it occurs.

This task tracks moving this code to a DEBUG-only assertion: https://github.com/TextureGroup/Texture/issues/335
2017-06-06 12:38:37 -07:00
Adlai Holler
a9837f2dc8 Replace NSMutableSet with NSHashTable when Appropriate #trivial (#321)
* Use NSHashTable to avoid needless -hash and -isEqual: calls

* Mark debug-only methods as such for clarity

* Address feedback
2017-06-05 16:33:37 -07:00
Garrett Moon
d5f10652c6 Fixes an issue with GIFs that would always be covered by their placeholder (#326)
Also adds a subclass override for when the animated image is set.
2017-06-02 16:13:36 -07:00
Adlai Holler
4d0eeb64d8 Rejigger Cell Visibility Tracking (#317)
* Rejigger visible elements tracking

* Put the assertion back

* Remove unused stuff

* Make it stronk
2017-05-30 10:25:13 -07:00
appleguy
6a28b740e6 [Cleanup] Small fixes to improve conformance for strict compiler settings #trivial (#320) 2017-05-29 18:11:18 -07:00
Adlai Holler
b7cd0b1656 Cleanup ASAsyncTransaction a little bit (#316) 2017-05-29 16:27:30 -07:00
appleguy
b285ece35f [Yoga] Implement ASYogaLayoutSpec, a simplified integration strategy for Yoga. (#270)
* [Yoga] Implement ASYogaLayoutSpec, an experimental alternative to full-tree integration.

This approach allows us to avoid any ASDisplayNode.mm integration points.
However, it is not yet proven to be possible to achieve correctness with this approach.

The entry point (to start calculating), and the measurement function inputs, lack
the full expressiveness of ASSizeRange; we need to make sure that workarounds like
using style.minSize are successful in simulating the behavior of a full Yoga tree.

* [Yoga] Fix file comments, move towards <ASLayoutElement> support.

* [Yoga] Important fix for simplified, non-contiguous Yoga integration.

* [Yoga] Complete implementation of manual memory management (__bridge_transfer, YGNodeFree)
2017-05-29 15:39:24 -07:00
Adlai Holler
7961aa919a Cleanup ASDisplayLayer (#315) 2017-05-29 15:38:27 -07:00
Flo
be956e91c6 [ASCollectionNode] Fix missing properties and layoutInspector #trivial (#305)
* [ASCollectionNode] Set the layoutInspector from the pendingState in didLoad.

* [ASCollectionNode] Forward scroll properties from the view.
2017-05-29 13:43:29 -07:00
appleguy
f7b9855da7 [ASDisplayNode] Revise assertion to log until Issue #145 is addressed. (#313)
[ASDisplayNode] Revise assertion to log until Issue #145 is addressed. #trivial
2017-05-29 10:59:11 -07:00
Garrett Moon
6b54d052e9 Fix non layout (#309)
* Lock released between add to pend controller and modifying pend state

The existing design is pretty fraught with error. We should probably
rethink this but in the meantime, this fixes a bug where calling
setNeedsLayout can start failing for nodes.

Essentially the method ASDisplayNodeShouldApplyBridgedWriteToView has
a side effect of registering a node to apply it's pending state *if*
it doesn't currently need the pending state applied. My guess is this
was to avoid continually registering the node and this behavior actually
helped expose this bug.

The bug: after the node is registered for flushing it's state, several
code paths released the lock before applying that state to the pending
state object. Before it could re-obtain the lock to apply it to the pending
state, the pending state controller flushed it on the main thread.

On subsequent calls to setNeedsLayout, the pending state had pending state
already (from previous calls which missed the flush) and thus wasn't
registered for future flushing.

* Add changelog
2017-05-26 14:59:02 -07:00
Adlai Holler
f8c16b7f3a Catch Invalid Layer Bounds in a Nonfatal Assertion #trivial (#308)
* Add a non-fatal assertion for setting invalid layer bounds.

* Update message
2017-05-24 12:56:08 -07:00
Michael Schneider
8a9c6e8145 Remove assertion in calculateSizeThatFits: and add a log event (#299) 2017-05-23 08:14:26 -07:00
Michael Schneider
a6c3517cf6 IGListKit related headers need to be in the module all time now (#300) 2017-05-22 09:50:11 -07:00
Huy Nguyen
6db8cc1551 ASBatchFetching to not round scroll velocity (#294)
- Doing so causes remaining time to be slightly inaccurate.
2017-05-19 15:07:08 +01:00
Huy Nguyen
6aa5ad7703 Only call -layout and -layoutDidFinish if the node is already loaded (#285)
* Only call -layout and -layoutDidFinish if the node is already loaded

* Minor change

* Update CHANGELOG
2017-05-19 15:06:26 +01:00
Sergey Petrachkov
0e4d48acb7 [ASVideoNodeDelegate] fix for #291 crash (#292)
* Fixed bug where ASVideoNodeDelegate error reporting callback would crash an app because of not responding to selector;

refs #291

* updated changelog.md

* fixed typo in const name of ASVideoNodeDelegate method in delegate flags;

refs #292
2017-05-18 12:27:16 +01:00
Adlai Holler
d30c35787c Fix Alignment of Hashed Structs (#287)
* Fix alignment of ASImageNodeContentsKey struct to fix hashing

* Change the change log by logging a change

* Add the world's stupidest explicit cast

* Actually its simpler
2017-05-17 18:08:50 -07:00
Huy Nguyen
8c45eaefce [Batch Fetching] Add ASBatchFetchingDelegate (#281)
* Add ASBatchFetchingDelegate
- In addition to checking remaining leading screens, ASBatchFetching now also calculates a remaining time and consults its delegate if needed.
- The delegate can override the decision of ASBatchFetching, for example based on remaining time and average time of past batch requests.

* Fix up tests

* Update CHANGELOG
2017-05-17 13:26:30 +01:00
Adlai Holler
432018cfdc Ignore Relayout Requests for Deleted Cell Nodes (#279)
* Data Controller: Ignore relayout requests for elements that have been deleted in the mean-time.

* Bolster our logchange

* Add sanity check
2017-05-16 11:31:15 -07:00
Adlai Holler
9c07aff695 Remove unused cell node method (#278) 2017-05-15 16:36:29 -07:00
Adlai Holler
7df1a20c5f Simplify Layout Transition State #trivial (#269)
* Port the changes to the latest master

* Remove extra s
2017-05-15 16:33:44 -07:00
Adlai Holler
a1b6fd2cd7 Fix documentation warnings (#276) 2017-05-15 13:31:20 -07:00
Michael Schneider
b32e69d64b [Layout] Extract layout implementation code into it's own subcategories (#272)
* Extract layout code into ASDisplayNode categories

* Category renaming and documentation

* Changelog

* Change header
2017-05-15 11:10:59 -07:00
Adlai Holler
9d84b9e635 Fix release builds (#271) 2017-05-14 15:52:06 -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
Adlai Holler
6d113f7a9d Use pthreads to back ASLayoutElementContext instead of std::map (#268) 2017-05-14 10:08:22 -07:00
Adlai Holler
538a02f119 Simplify Override Checking, Only Do It When Assertions Are Enabled #trivial (#253)
* Simplify our override checking, only do it when assertions are enabled

* Move those functions under the ASSERTIONS_ENABLED check
2017-05-11 11:42:15 -07:00
Adlai Holler
f2c85fdc32 Fix Collection Item Index Path Conversion (#262)
* Fix the conversion order for collection index paths

* Update the changelog
2017-05-11 10:44:21 -07:00
Sergey Petrachkov
4b114e841b added error reporting callback to ASVideoNode (#260)
* added error reporting callback to ASVideoNode

* updated Changelog.md

* updated code according to review notes:

- preserved two-spaces indentation;
- extended error reporting callback with key and asset, updated method call;
2017-05-11 12:23:12 +01:00
ricky
002f470331 [ASTextKitFontSizeAdjuster] Replace use of boundingRectWithSize:options:context: with boundingRectForGlyphRange: inTextContainer: (#251)
* [ASTextKitFontSizeAdjuster] Replace use of boundingRectWithSize:options:context: with boundingRectForGlyphRange: inTextContainer:

`boundingRectWithSize:options:context:`  started returning different values for the same strings between iOS 10.2 and iOS 10.3. Switching to using `NSLayoutManager`’s `boundingRectForGlyphRange: inTextContainer:` fixed this. It also makes sure we are consistent with what `ASTextKitTailTruncater` uses.

* updated changelog
2017-05-10 18:40:22 -07:00
Huy Nguyen
34397235bb Add missing import and define in ASLog (#257) 2017-05-10 17:09:07 -07:00
Adlai Holler
0143e3291a Improve Ancestry Handling, Avoid Assertion Failure (#246)
* Improve our handling of ancestry

* Increase chungalunga
2017-05-09 18:27:54 -07:00
Michael Schneider
4dbbba7d32 Remove instance method of -drawRect:withParameters:isCancelled:isRasterizing: (#232) 2017-05-09 14:02:33 -07:00
Michael Schneider
3738f1f6e2 [ASImageNode] Move to class method of displayWithParameters:isCancelled: for drawing (#244)
* Remove instance displayWithParameters:isCancelled:

* Address comments
2017-05-09 13:03:30 -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
Alejandro Megías
ad9924abd8 [ASDimension] Remove warning about float precision using CGFloat and Double (#237)
[ASDimension] Remove warning about float precision using CGFloat and … #trivial
2017-05-08 14:12:12 -07:00
Garrett Moon
850aeb442c Assert only once we know URL has changed (#247)
We need this in case someone is setting the URL to nil before setting
the image directly. I.e. they have a node which has been used as a network
node or an image node but now they want it to be an image node.

They should then set the URL to nil and then set the image.
*if* it was used as a network node previously, this would work.
If it was previously used as an image node it would historically assert.
This addresses that.
2017-05-05 16:32:54 -07:00
Adlai Holler
80357b1c7c Don't use associated objects for ASDisplayNode.drawingPriority (#239) 2017-05-05 08:22:30 -07:00
Michael Schneider
17d956493a [ASImageNode] Move debug label and will- / didDisplayNodeContentWithRenderingContext out of drawing method #trivial (#235)
* Move configuring the debug label from the drawing method in displayDidFinish

* Move will- and didDisplayNodeContentWithRenderingContext in drawing parameters
2017-05-04 16:56:26 -07:00
Adlai Holler
588f30c7dd Move Last Few Properties from ASTableView,ASCollectionView to Node (#225)
* Finish moving properties ASTableView->ASTableNode, ASCollectionView->ASCollectionNode

* Update changeling
2017-05-04 13:41:58 +01:00
Michael Schneider
25da46c8ac Remove unneeded pointer star (#231) 2017-05-04 13:41:35 +01:00
Huy Nguyen
ca2885cf06 Implement ASPageTable (#81)
* Implement ASPageTable
- It is a screen page table that can be used to quickly filter out objects in a certain rect without checking each and every one of them.
- ASCollectionLayoutState generates and keeps a table that maps page to layout attributes within that page.
- ASCollectionLayout (and later, ASCollectionGalleryLayoutDelegate) consults its layout state for `layoutAttributesForElementsInRect:`. This ensures the method can return as quickly as possible, especially on a large data set (I heard some people have galleries with thousands of photos!).

* Address comments

* Handle items that span multiple pages

* Make danger happy
2017-05-04 12:43:02 +01:00
appleguy
98a8c38ce2 [ASTwoDimensionalArrayUtils] Fix extern C function definition to fix compiler issue. (#229)
In some build environments, this causes an error. It seems to be a change since 2.2.
2017-05-03 15:58:03 -07:00
Michael Schneider
82b7806473 [Layout] Remove finalLayoutElement (#96)
* Remove finalLayoutElement

* Add changelog

* Remove some documentation
2017-05-03 10:45:01 -07:00
Michael Schneider
b6734faa3b Extract ASLayoutElement and ASLayoutElementStylability into categories #trivial (#131)
* Initial move of code into layout category

* Cleanup

* Some more
2017-05-02 14:38:06 -07:00
Adlai Holler
a7656766f9 Make Cell Node Properties Atomic (#74)
* Make ASCellNode indexPath and supplementaryElementKind atomic

* Update the change log

* Fix licenses

* Be explicit with atomic

* Rename the protocol

* And the file
2017-05-02 14:09:12 -07:00
Phil Larson
471f02daa7 Automatically resume ASVideoNode after returning from background (#13) 2017-05-02 13:13:16 -07:00