Commit Graph
5066 Commits
Author SHA1 Message Date
Huy Nguyen 3c8acbc1de Force podspec linting on git push 2020-01-02 14:03:29 -08:00
Huy Nguyen 397bab595f Print IGListKit's error out 2020-01-02 14:01:23 -08:00
Hanton Yang 69ae7ddf79 Simplify push_back GroupNotify (#1736) 2020-01-02 11:45:34 -08:00
Andrew Yates 005e2d5aa9 First pass at supporting new traits (#1568) 2020-01-02 10:37:42 -08:00
Hanton Yang 6a2fdb2606 Use queue in ASMainSerialQueue (#1738)
For removing the first element, time complexity of `NSMutableArray` is O(n) while `queue` is O(1), which is more efficient.
2019-12-28 00:02:26 -08:00
Andrew Yates 4596a0f58c Bump up IGListKit version (#1749) 2019-12-27 23:56:45 -08:00
Craig Howarth b59c6d07e1 [ASCollectionLayout] Fix element lookup for supplementary attributes (#1707) 2019-12-23 16:17:14 -08:00
Hanton Yang 88a640add8 Delete unused macro in ASControlNode (#1734) 2019-12-23 13:29:55 -08:00
Adlai Holler d688ce3d20 Improve recursive unfair lock: (#1742)
- Use relaxed memory since we don't need acquire/release. This'll make it faster.
- Add a couple assertions and organize the code better.
- In contested case, just lock instead of tryLock-fail-lock.
- In recursive case, do not tryLock. Just notice it's recursive and be done.
- In uncontested case, just lock instead of tryLock.

PRESUBMIT=passed
BUG=137413265
R=maicki
CC=maxwang,rexhu,wiseoldduck,yt-elements-eng+cl
REQUIRED_REVIEW=1
DELTA=50 (14 added, 13 deleted, 23 changed)
DELTA_BY_EXTENSION=h=1,mm=36
OCL=278419008


P4 change: 278454084
2019-12-10 13:51:14 -08:00
Hanton Yang 9337795419 [Docs] minor fixes in Layout (#1735) 2019-12-04 22:16:26 -08:00
Hanton Yang 294f27b790 Delete unused header in ASRunLoopQueue (#1737) 2019-12-04 22:15:38 -08:00
Luke Zhao cbc5104c15 Fix tint color dead lock #1731 (#1732)
* fix tintColor dead lock

update to use scoped lock

* pull other accessor out of the scoped lock

* fix ASTextNode
2019-11-25 09:49:27 -08:00
Hanton Yang 37e28300de Add copy sematic to userInfo in ASTextRunDelegate for avoiding mutation (#1719) 2019-11-12 10:42:05 -08:00
Hanton Yang be96501df9 [Docs] Update to use ASCornerLayoutSpec for Photo with Outset Icon Overlay (#1721) 2019-11-12 10:40:39 -08:00
Hanton Yang e7803010de Remove unused sharedDeallocationQueue property (#1717) 2019-11-11 10:57:03 -08:00
Hanton Yang 5f433008cd Change layoutSizeDifferentFromBounds macro to a BOOL (#1718) 2019-11-11 10:56:38 -08:00
darrengyles 744bb3ecd3 Fix for images retrieved from the memory cache being reported a… (#1722)
* Fix for incorrectly reporting images retrieved from the memory cache as disk (i.e. asynchronous) cache hits.
2019-11-07 10:25:04 -08:00
Minhoi Goo 278ea43f39 modify examples_extra/Shop swift 4.2 Version (#1709)
* modify examples_extra/Shop swift 4.2 Version

* Delete Podfile.lock

Delete Podfile.lock
2019-10-23 12:22:43 -07:00
Hanton Yang 0ec2bece8f AS::Map function improvement (#1642)
* Prefer `reserve` rather than `fill constructor` in AS::map()

`fill constructor` constructs the vector with n elements and initializes each element with its default constructor. Instead, `reserve` just allocates memory, no element is initialized and put into the vector, so it's more effeicent. For example, after running the `result_type res(iterable.size());` statement, the `res` vector's size is equal to `iterable.size()`, but after running the `res.reserve(iterable.size());` statement, the `res` vector's size is 0.

* Add tests for ASLayoutSpecUtilities
2019-10-23 11:23:13 -07:00
Wooseong Kim a890f75019 Fix comment typo for showsHorizontalScrollIndicator (#1638) 2019-10-22 12:31:59 -07:00
vovasty 18fa714c3f deprecate ASGraphicsCreateImageWithOptions (#1704) 2019-10-16 13:20:39 -07:00
Hanton Yang 396672ca2a Remove duplicate ASPINRemoteImageDownloader (#1705) 2019-10-11 15:13:29 -07:00
Hanton Yang 4c9000c0db Remove build warnings (#1681) 2019-10-10 11:21:29 -07:00
Hanton Yang d09c967cc6 [Docs] Fix broken link in Layout-Quickstart (#1648) 2019-10-09 12:54:50 -07:00
vovasty 6baf29a8a0 fix a node background color in non layer baked mode. (#1693) 2019-10-08 15:50:58 -07:00
vovasty 17b3ae9b03 use iOS 13.0 and Xcode 11 on CI (#1691) 2019-10-08 15:32:48 -07:00
Vitalii Kuznetsov dab927bb22 fix typo in ASVideoNodeDelegate protocol (#1695)
Signed-off-by: Vitalii Kuznetsov <v-blacksmith@hotmail.com>
2019-10-02 08:47:39 -07:00
Rahul Malik ee18b9cd6c Use backgroundColor ivar instead of property access in traitCollectionDidChange (#1678)
traitCollectionDidChange isn't necessarily called on Main, but our self.backgroundColor property access must be done on main once the view is loaded.

I originally opted to use self.backgroundColor rather than _backgroundColor in #1674, but I think we should use the ivar here. This could get out-of-sync if someone modified the UIView's background color instead of updating the node, but I think that's unlikely, so we should be safe to use the ivar here.
2019-09-18 09:15:32 -07:00
Hanton Yang 06ab67a3aa Using emplace_back, it avoids the move operation requires when using push_back (#1658) 2019-09-18 00:07:03 -07:00
Rahul Malik 618f21e28a Fix main thread assertion for tint color on text nodes, re-render tint-able nodes on hierarchy changes (#1670)
- Address various issues with tint color on text nodes
- Avoid accessing `self.tintColor` off-main since this will trigger an
assertion and might be undefined behavior
- Trigger setNeedsDisplay in cases of hierarchy change and
tintColorDidChange in ASButtonNode, ASTextNode{1,2}
- Fix bug in _ASTableViewCell where we were overwriting the tint color
instead of inheriting the correct value
- Add tests for new logic in changing hierarchy
2019-09-16 14:38:50 -07:00
vovasty e5eba118a3 introduction of ASGraphicsCreateImageWithTraitCollectionAndOptions (#1675)
* initial `ASGraphicsCreateImageWithTraitCollectionAndOptions`

* comments
2019-09-16 14:14:53 -07:00
Harry Shamansky 0b02e8bdf8 #1673 - Re-render Clipping Corners when User Interface Style Changes (#1674)
* This PR addresses an issue I raised with #1673 where the clipping corner layer doesn't get re-rendered when going from a dark to light user interface style. The fix is to add code in the `-asyncTraitCollectionDidChangeWithPreviousTraitCollection:` method that calls through to `-_updateClipCornerLayerContentsWithRadius:backgroundColor:` if the user interface style changes.

I've also added snapshot tests to verify that using clipping corners with a dynamic background color updates when the user interface style changes.
2019-09-16 14:14:10 -07:00
Hanton Yang 712efc434f Fix _ASAsyncTransaction initialization method (#1656)
- Invoke the superclass (super) initializer
2019-09-15 23:33:29 -07:00
Mike Donahue 3bb64bc1cc Fix CFRelease crash in ASTextNode2 (#1669)
- Add null check before CFRelease
2019-09-11 22:07:21 -07:00
Greg Bolsinga 368aa3aadf ASImageNode tintColor improvements. (#1668)
* ASImageNode tintColor improvements.

When ASImageNodes changes tintColor or enters the hierarchy, ensure -setNeedsDisplay is called if the image is templated.

Add unit tests to ensure this behavior works.
2019-09-11 20:18:04 -07:00
Greg Bolsinga 492da8a95b Node TintColor Tweaks (#1666)
* Node TintColor Tweaks

- If the tint color changes, be sure to call -setNeedsDisplay on the view.
- Explictly declare tintColor ivar and getter method.
- If the tintColor is the same as the existing one, early-exit.
- Use the ivar and not the property when setting the tintColor, just as is done for background color.
- Add tests (for non iOS13 and iOS13) that the tintColor will call -setNeedsDisplay
- Backfill tests to document/verify the tintColor behavior on a node.
2019-09-11 14:22:39 -07:00
Hanton Yang c99bcb02f8 Use CAEdgeAntialiasingMask instead of unsigned int (#1667) 2019-09-11 10:38:06 -07:00
Michael Zuccarino 5e7fbf2ff9 Defer image asset regeneration to draw loop (#1663)
There is a potential dealloc race condition that can occur when attempting to perform work with image asset out of the main thread. Moving that work into the image node draw loop if necessary
2019-09-07 03:37:43 -07:00
Greg Bolsinga c24a21a5a9 lock to access the image renderingMode (#1661) 2019-09-06 13:11:10 -07:00
Greg Bolsinga a403160930 Use MutexLocker for safe locking and then access the ivars directly so that another lock access is not required (#1662) 2019-09-06 13:02:16 -07:00
Greg Bolsinga 00c03e8fcb Use standard ivar _ prefix for userInterfaceStyle (#1660) 2019-09-06 12:59:15 -07:00
Jakub Kašpar d0ab404c34 [GitHub CI] Revert back to Ruby Danger as Danger JS is not working properly (#1650)
* Update ci.yml

Add name to the script run phase

* Revert back Dangerfile and remove danger JS, create separate workflow for push for tests and for PR for tests + danger, run ruby danger as part of the PR check

* remove PR ci

* Revert "remove PR ci"

This reverts commit 839ba3ae2a.

* cahnge token to default one

* PR feedback

* Rename danger.yml name
2019-08-31 08:14:17 -07:00
vovasty 4d6532ccc8 use lock to avoid crash when image might be changed during the trait collection change (#1651) 2019-08-30 12:45:58 -07:00
vovasty 0cd5561fd6 tests for ASImageNode dynamic tint color (#1644) 2019-08-30 11:13:31 -07:00
Rahul Malik 6464153489 Cleanup from recent changes (#1647)
- Fix availability warnings for usage of userInterfaceLevel
- Deprecate `asyncTraitCollectionDidChange` in favor of the new method
- Remove old compiler warning flag added for Xcode 9 building
- Access `textColorFollowsTintColor` with a locked scope
sync-base-08-29-19
2019-08-28 12:24:03 -07:00
Rahul Malik dfe0f57311 Propagate ASTraitCollection for snapshot testing (#1646)
Our helper methods set the current trait collection on the node we want
to snapshot but did not propagate the trait collection as expected.
2019-08-28 10:43:00 -07:00
Rahul Malik caa0d8de54 Fix issue where UIGraphicsRendererFormat is mutated (#1645)
* Fix issue where UIGraphicsRendererFormat is mutated

As part of https://github.com/TextureGroup/Texture/pull/1629, we use the
preferred or default UIGraphicsRendererFormat. This was pointing to a
static variable which content scale was mutated across several graphic
render passes and lead to pixelated views.

* Update reference images with iOS 10.3
2019-08-27 13:51:38 -07:00
Rahul Malik bda0a5b22b Track backgroundColor in ASDisplayNode (#1640)
To preserve dynamic color capabilities for layer-backed
nodes, we need to track backgroundColor as a UIColor. In layer backed nodes we lose the dynamic color logic since we
extract a CGColor from the UIColor applied to ASDisplayNode. With this
change we can respond to changes in UITraitCollection.userInterfaceStyle
for backgroundColor.
2019-08-26 17:58:53 -07:00
vovasty 1961a5a948 Add support for loading image variants through Asset catalogs (#1630)
Currently ASImageNode would initially load the correct asset from the asset catalog but would not respond to changes in trait collections that would require loading a different asset from the asset catalog. This change allows use to use `-[UIImage imageAsset]` to reference the asset catalog entry for the current image and load the appropriate version based on the current trait collection
2019-08-23 14:42:05 -07:00
Hanton Yang 762c8e8bff Keep using unowned macro (#1626) 2019-08-22 17:02:50 -07:00