Commit Graph
5092 Commits
Author SHA1 Message Date
Hanton e93e666f45 [Examples] Fix all project coding warnings in examples folder (#1582) 2019-07-28 13:09:02 -07:00
Hanton 4a2d77dc9e [Examples] Migrate to the recommended -nodeBlock data source method, so node containers will be able to prepare and display all of its cells concurrently (#1596) 2019-07-28 13:08:28 -07:00
Hanton b933f661b9 Use AS_ARRAY_SIZE for array counting (#1600) 2019-07-28 13:07:54 -07:00
Huy Nguyen 67f2ea5c42 Add dev docs navigation (#1599) 2019-07-26 08:09:40 -07:00
Hanton 7aba2873b1 [Dev docs] fix broken image links (#1597) 2019-07-25 15:39:38 -07:00
Wu Zhong 9cedd4e3e6 Add download progress support to ASNetworkImageNode (#1489) 2019-07-24 22:44:16 -07:00
Rahul Malik 4ebd38c316 Update ASPendingState type for backgroundColor to UIColor
Given that UIColor is now a dynamic provider we can no longer rely on the fact that there is a 1:1 mapping between UIColor <-> CGColorRef.

I've updated the UIViewBridge and ASPendingState accordingly to use UIColor and translate to CGColorRef only when interacting with layers. This should preserve any dynamic capabilities we might need in the future when trying to re-render layer backed nodes.
2019-07-20 18:53:37 -07:00
Rahul Malik d4d6897a97 Set background color directly to view if not layer backed (#1588)
* Set background color directly to view or layer depending on if the node
is layerBacked.

Summary:
UIColor can now be a dynamic color provider to support capabilities like Dark Mode in applications. UIKit is able to re-render views when a user enters dark mode but this dynamic capabilities is not handled at the layer level.

Currently this takes the recommendation in facebookarchive/AsyncDisplayKit#1537 (comment) to set background color on the view directly or layer depending on if the node is layer backed. This change allows UIKit to track these colors and update the UI when the UITraitCollection.userInterfaceStyle changes.

* Updates to UIViewBridge to fix tests

* Remove opaque

* Test fixes

* Revert change to test checker method

* Fix strange issue where setting UIView backgroundColor sets the layer to
opaque to false

* Address Huy comments

* Address last comment
2019-07-19 19:17:01 -07:00
ernestmama 9c537ead5d Add a new networking image delegate method when a network image node failed to load from cache (#1590) 2019-07-19 11:45:37 -07:00
Huy Nguyen b0382994b7 Fix missing app icon in Showcase page 2019-07-18 09:37:06 -07:00
Huy Nguyen 4ddb785cab Minor changes to showcase.md 2019-07-18 09:32:47 -07:00
Chetan Garg c24d4c1870 Add Longwalks app to Showcase page (#1556) 2019-07-18 09:29:28 -07:00
Michael Zuccarino 935abc4b51 Add link to Getting Started to Overview page (#1587) 2019-07-15 18:14:39 -07:00
Huy Nguyen 45f1611ccb [Dev doc] Improve title of how-to-debug.md (#1586) 2019-07-15 13:53:54 -07:00
Huy Nguyen b15bcfd6d7 [Dev docs] Update navigation bar (#1585) 2019-07-15 13:53:32 -07:00
Huy Nguyen 8640d568f4 [Dev doc] Minor updates to collection-asynchronous-updates.md 2019-07-15 12:14:21 -07:00
Hanton 88946c4b93 Update docs navigation orders (#1584) 2019-07-15 12:02:43 -07:00
Greg Bolsinga 7da85c5008 Run Import Optimizer on Texture (#1580)
* Run Import Optimizer on Texture
2019-07-11 19:19:13 -07:00
Hanton b7d64a0917 Fix the build warning in ASRangeController.mm (#1575) 2019-07-11 12:14:14 -07:00
Rahul Malik 6176aa4bc9 Bridge CTFontRef directly to UIFont when converting attributes on NSAttributedString (#1579)
In iOS13, there is an issue with the font returned from "-[UIFontj fontWithName:size:]". When asking for "SFUI-Regular" returns "Times New Roman" font.

It isn't clear why we were trying to create a new font instance when CTFontRef toll-free bridges to UIFont. This appears to pass tests both internally at Pinterest and Texture so I feel like the change is pretty safe and should also solve the iOS 13 regression users are experiencing.
2019-07-11 11:54:33 -07:00
Sterlingster 901f4dd97f Fixes accessibilityLabel bug on ASButtonNode that has no title (#1573) 2019-07-10 20:03:39 -07:00
Hanton 00d76ceee3 [Dev doc] Add Carthage version (#1578) 2019-07-10 20:00:44 -07:00
Hanton 083f081634 Update CONTRIBUTING.md (#1574)
* Change namespace `ASDN` to `AS`
2019-07-10 10:55:08 -07:00
Michael Schneider 18e55277dc Fix truncation token is wrong after attributed string is changing with different foreground color (#1550) 2019-07-02 06:56:50 -07:00
Huy Nguyen 6e46d9bcd5 [ASDataController] Add an experiment that avoids flushing editing queue before starting the data pipeline pipeline (#1564)
* [ASDataController] Avoid flushing editing queue before starting data controller pipeline

Step 1 of the pipeline is on main thread and needs pendingMap which was updated by the end of step 1 of the run. And step 1 operates on data source index space. So it should be ok to start it ASAP -- without waiting for any running work on the background editing queue.

One potential race condition after this change is that it's possible for main thread to query the data source (step 1) while the editing queue consumes the last change set (step 3). However, as long as the client's each nodeBlock and the node's layout code capture/reference an individual model object (as opposed to the whole data set) -- which is what clients are supposed to do anyways, then everything should be fine.

The benefit of this diff is that the pipeline will be able to accept many more change sets within a short time window, for example when clients submit a burst of separate small updates.

I tested this diff against our test suite several times and smoke tested it in our code base without any issues.

* Wrap in an experiment

* Enable experiment in tests

* Minor change
2019-06-30 21:08:06 -07:00
LiuJian 59ab0e8773 Fix placeholder (#1555)
* Fix placeholder

* [Unit Tests] Add Placeholder Test (#1555)
2019-06-28 10:40:45 -07:00
Huy Nguyen d4c0d74fc9 [Dev doc] Add overview and explain repository structure (#1562) 2019-06-27 14:25:27 -07:00
Michael Zuccarino 45df8d755f [dev doc] Layout Specs (#1557) 2019-06-27 11:00:27 -07:00
Michael Zuccarino d835fb3f2b [dev docs] Remove redundant page (#1563) 2019-06-27 11:00:02 -07:00
Michael Schneider d7239baaa4 Fix ASTextNode2 supportsLayerBacking (#1545)
`[NSAttributedString enumerateAttribute:inRange:options:usingBlock]` can be called multiple times with a value of nil. The current logic didn't consider this to find out if a links is present within the attributed string.
2019-06-25 15:03:12 -07:00
Huy Nguyen a11c08497b [Dev doc] Collections and asynchronous updates (#1558) 2019-06-25 12:52:41 -07:00
Huy Nguyen e274e5dac5 Remove ivar of ASCellNode.owningNode (#1559) 2019-06-25 10:58:43 -07:00
Huy Nguyen ba1e0acb1e Restore call pattern where UIView methods drive __enterHierarchy and __exitHierarchy for view-backed nodes (#1561)
After #1396, some view-backed nodes in our app stop responding to tap events. I tracked it down to [this change](https://github.com/TextureGroup/Texture/pull/1396/files#diff-7fbc7d84a259cbfbee7546a5310dddcfR162) which suggests that the order of execution matters.

This diff attempts to fix the issue by restoring the previous call order where `__enterHierarchy` and `__exitHierarchy` are driven by `_ASDisplayView`'s `-willMoveToWindow:` and `-didMoveToWindow` if the node is view-backed. Layer-backed nodes will still call `__enterHierarchy`/`__exitHierarchy` when they get `kCAOnOrderIn`/`kCAOnOrderOut`.

This maintains the layer-action support introduced in #1396.
2019-06-25 10:58:13 -07:00
Huy Nguyen 533c7eba1c [Dev docs] Node Lifecycle (#1536)
* [Dev docs] Node Lifecycle

Here is my draft on a new documentation aims at people interested in learning about technical details of the lifecycle of ASDisplayNode, as well as its interface and loading states. Hopefully it'd be useful for others who want to ramp up and hopefully start contributing to the framework.

Let me know if there are other topics I should cover, or anything I should explain more/dig deeper, or something that is wrong/no longer valid (imposter syndrome much!). Cheers!

* Update node-lifecycle.md

* Address comments
2019-06-20 13:56:10 -07:00
Garrett Moon 71d6238fed #trivial fix development sidebar in docs (#1554) 2019-06-17 11:04:01 -07:00
Greg Bolsinga c67acab290 Remove ASExperimentalTransactionOperationRetainCycle (#1547)
* Remove ASExperimentalTransactionOperationRetainCycle
2019-06-13 15:42:24 -07:00
Garrett Moon 2de8eec67e Upgrade Xcode and Cocoapods (#1552)
* Upgrade Xcode

* Update examples for new cocoapods / swift

* Fix carthage mode in build.sh
2019-06-12 18:41:54 -07:00
Garrett Moon ef06cfe843 Update how to contribute docs (#1553) 2019-06-12 16:29:32 -07:00
Huy Nguyen 9b8120656b [Dev docs] How to develop with Texture (#1538) 2019-06-11 16:59:10 -07:00
Michael Schneider 172614855a Adjust how AS_ENABLE_TEXT_NODE is used to fix Xcode cmd+click & editor support. (#1546) 2019-06-10 15:17:37 -07:00
Michael Zuccarino a6a03c638b [Dev docs] Debugging documentation (#1328)
* Starting doc skeleton and debugging UIKit crash document

* Iterate Debugging docs

* Scope to only debug, include Weaver

* Typos
2019-06-10 10:40:54 -07:00
Wu Zhong 1cb2334cf0 NetworkingImageNode: update URL if we found image in assets (#1473) 2019-06-07 16:00:25 -07:00
Adlai Holler 731db8c9ee In text measurement, don't eagerly create arrays for attachments since we don't usually have attachments. (#1535)
PRESUBMIT=passed
R=mcudich,wiseoldduck
CC=maxwang,yt-elements-eng+cl
APPROVED=mcudich
REQUIRED_REVIEW=1
DELTA=25 (11 added, 8 deleted, 6 changed)
DELTA_BY_EXTENSION=mm=17
OCL=242501658
NO_SQ=Test failures are unrelated.


P4 change: 242514626
2019-06-06 07:50:19 -07:00
Michael Schneider 19fb1240ad Fix multiple issues around accessibility handlinig (#1537)
* Improve Accessibility Implementation

- Fixes calculations for accessibilityFrame of ASAccessibilityCustomAction and ASAccessibilityElement
- Fix crash for accessibility elements within layer backed nodes
- Fix accessibility action label updating after other actions change the accessibility label of the corresponding node

* Address comments
2019-06-05 13:51:25 -07:00
Michael Schneider ab8ea069ea Add support for basic ASTextNode2 link highlighting (#1518)
* Add support for basic ASTextNode2 link highlighting

* Add approach to fix line highlighting

* Enable proper highlighting for first row

* Fix snapshot highlighting test for ASTextNode2

* Update screenshot again

* Address comments
2019-06-03 08:57:31 -07:00
Adam Bell 1b4b6a3f02 Fix Opting-Out of Linking with Photos Framework (#1519) 2019-06-03 08:56:48 -07:00
Garrett Moon a3f25d05f9 Remove the text rendering experiment. (#1531)
* Remove the text rendering experiment. It decreased rendering speeds at a negligible improvement to OOMs.

* Adopt new ASGraphicsCreateImageWithOptions API
2019-06-03 08:56:31 -07:00
Michael Schneider 62e5a8e86c Use flag for responder chain methods between view and node dispatching (#1522)
* Use flag for responder chain methods between view and node dispatching

* Use bitfields
2019-05-30 07:18:07 -07:00
Michael Schneider a2abd00276 Fixes UIKit version of ASDKGram (#1521)
* Several fixes for UIKit version of ASDKGram

* Remove PhotoCollectionViewCell
2019-05-29 10:32:21 -07:00
Michael Schneider 08d5e81e3b Remove ASExperimentalDisableAccessibilityCache (#1515)
* Remove ASExperimentalDisableAccessibilityCache

* Some more removal
2019-05-29 09:38:01 -07:00