Commit Graph
25 Commits
Author SHA1 Message Date
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
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
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
vovasty 0cd5561fd6 tests for ASImageNode dynamic tint color (#1644) 2019-08-30 11:13:31 -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
Rahul Malik e0d5cedd23 Dark Mode dynamic rendering preparation, adding experiment to propagate older trait collections (#1637)
- Adding experiment to propagate older trait collections when trait
collections change
- Re-render nodes when user interface style changes (dark mode)
- Snapshot testing examples for dark mode
- Fixes for applying trait collection overrides in XCTest
- Create new define for gating Xcode 11 / iOS 13 features until CI is running it
2019-08-22 15:53:17 -07:00
Jessie Alvarez ccee5666dd Allow full color tinting on grayscale template images. (#1629)
* Allow full color tinting on grayscale template images.

* Signing a commit with the correct email address.

* Add snapshot test for a grayscale image with ASExperimentalDrawingGlobal enabled.
2019-08-22 12:53:49 -07:00
Rahul Malik b9903a4155 Add support for tinting layer-backed ASDisplayNode (#1617)
* Add support for tinting layer-backed ASImageNode's

* Move tint color support ASDisplayNode

* Address comments, unlock before calling "tintColorDidChange" on
subclasses

* Address comments
2019-08-15 10:03:15 -07:00
Rahul Malik 540f1344ab Add support for tintColor on ASImageNode and ASButtonNode (#1603)
- Add the ability to specify a tintColor for images / buttons that behave similarly to how they would under UIKit.
- Add flag to control if tint color is applied to ASTextNode to match how
UIKit controls if it is .applied to UILabel.
- Update tests for not-tinting automatic render mode for UIImage.
- Add property on ASTextNode2.
- Add tint color support to ASTextNode2.
2019-08-12 09:14:54 -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
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
Adlai Holler fe1cb1c79d Add support for clipping only specific corners, add unit tests (#1415)
* Add support for clipping only specific corners, add unit tests

* Remove some cleanup to make the diff smaller

* Fix
2019-03-28 18:42:33 -07:00
Kevin 4c370a899c [Updated Snapshots] Don't add extraneous truncation token during kCTLineTruncationMiddle (#1375)
* Don't add extraneous truncation token during kCTLineTruncationMiddle

* Expand these comments a little.

* Update snapshot tests with beautiful correct behavior
2019-03-07 07:20:06 -08:00
Kevin 9428fd4b9c Add some snapshot tests for ASTextNode2 truncation modes. (#1296)
* Add some snapshot tests for ASTextNode2 truncation modes

* Allow some tolerance in snapshots

* Express tolerance percentage correctly

* Code review comments: Move class methods up, combine declaration&initializaiton lines

* Give png files clearer names

* Oops
2019-01-16 18:26:05 -08:00
Eric Jensen 5f912d1cd1 Remove double scaling of lineHeightMultiple & paragraphSpacing attributes in ASTextKitFontSizeAdjuster (#1056) 2018-08-15 11:08:32 -07:00
Michael Schneider 9e2947e7fb Revert "Optimize drawing code + add examples how to round corners (#996)" (#1055)
This reverts commit eb4c21c545.
2018-07-31 04:40:18 -07:00
Michael Schneider eb4c21c545 Optimize drawing code + add examples how to round corners (#996)
* Use CoreGraphics for drawing and cropping of node content

* Smaller fixes
2018-07-26 09:44:10 -07:00
Max Wang 9fe2f476a1 add ASTextNode2 snapshot test (#935)
* fix SIMULATE_WEB_RESPONSE not imported #449

* Fix to make rangeMode update in right time

* remove uncessary assert

* textnode2-snapshot-test

* add change log

* fix image recording

* disable recording

* renaming test method

* reset experiment in teardown
2018-06-02 09:01:01 -07:00
Adlai Holler 6f1d2d1f1d [ASTextNode] Fix locking, add test for issue #trivial (#825)
* A few small fixes plus a failing test for ASTextNode

* Change the approach

* Update changelog

* Eh screw null_resettable

* No need for changelog now
2018-03-09 14:23:27 -08:00
huang-kun e4b2c05c21 [ASCornerLayoutSpec] New layout spec class for declarative corner element layout. (#657)
* Add new layout spec class with snapshot testing. Update examples and CHANGELOG.md

* Code review updates.

* Open curly bracket in a new line.
2017-11-24 13:45:59 +00:00
Huy Nguyen 421a896713 Clean up snapshot test cases (#3091)
* Clean up snapshot test cases:
- Drop 32bit snapshots
- Update iOS 9 snapshots and move some others to the correct directory
- Remove `setUp` overrides in subclasses of `ASLayoutSpecSnapshotTestCase` that set `recordMode` flag. Doing so in multiple places make it difficult to enable/dis
able the flag for all layout spec test cases. It can always be overridden locally if need
to.
- Fix BUCK build

* Fix testThatOnDidLoadThrowsIfCalledOnLoadedOffMain of ASDisplayNodeTests
2017-02-27 09:14:40 -08:00
Adlai Holler 73ca6ab514 Shuffle & Cleanup Stuff (#3080) 2017-02-26 18:14:13 -08:00