Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45693
This wires box shadow application for `ReactImageViewManager` to `BackgroundStyleApplicator` for setting shadows. This same logic will get copy-pasted to other view managers later up the stack (including Vito images, ScrollViews, etc, then eventually View), until we are able to consolidate to BaseViewManager.
Changelog: [Internal]
Reviewed By: rshest
Differential Revision: D60266016
fbshipit-source-id: eaa842f539ee1654ab719c7d341b4b748db7a15c
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45780
D59300215 noticed that the drawable was leaking a clipping rect for the rest of the operations, and added a `save/restore` pair, but the save happens conditionally, so we can restore more often than we save, if we hit a fast path of not needing to invalidate the shadow RenderNode when drawing. This leads to the following unhandled exception:
```
java.lang.IllegalStateException: Underflow in restore - more restores than saves
at android.graphics.Canvas.restore(Canvas.java:647)
at com.facebook.react.uimanager.drawable.OutsetBoxShadowDrawable.draw(OutsetBoxShadowDrawable.kt:110)
at android.graphics.drawable.LayerDrawable.draw(LayerDrawable.java:1019)
```
This change moves saving canvas context to before setting state and drawing onto the canvas, instead of the area manipulating the RenderNode.
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D60375357
fbshipit-source-id: 773c733fce11ce89ab6741589eea19b6f060f9a3
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45692
This moves to using `BackgroundStyleApplicator` instead of `ReactViewBackgroundManager`, or Fresco based drawing, for setting background/border style props when the feature gates are right.
This will be ported to Vito (and... all the other built-in views) later up the stack.
Changelog: [Internal]
Reviewed By: joevilches
Differential Revision: D60265326
fbshipit-source-id: d9dea8d35eeb09a10d012c3ab93957dbf2ebfdd7
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45689
Going to use this to gate usage of the applicator, for each of the components, including `<View>`, which
This also conveniently sidesteps some unsavory reflection on View member happening that we can't clean up yet.
Changelog: [Internal]
Reviewed By: joevilches
Differential Revision: D60265327
fbshipit-source-id: fabac3ac8479ff359ae6d798407047287dc712f9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45688
Box shadows are handled as part of different drawables. We have other cases where we want to show multiple drawables at once, such as for ripple feedback, or more commonly, for app-wide TextInput styles (which adds padding).
With more multi-background scenarios in the future, and CSSBackgroundDrawable already way overloaded, the arch here I want to go towards is less drawables, as hidden implementation details, with single responsibilities, more often switched out. Once path logic is extracted, this would also allow for better fast-paths, like not needing to create a (heavy) CSSBackgroundDrawable, for simple views with a color background.
`CompositeBackgroundDrawable` is then a more structured LayerDrawable, which also lets us mutate or retrieve information from specific layers, and enforces the different types of layers are correctly z-ordered.
`BackgroundStyleApplicator` is the public API for manipulating these styles, inspired by the existing `ReactViewBackgroundManager`. There are some important design differences.
1. The only per-view state is the publicly accessible background drawable. This means the applicator can be used on arbitrary views, and eventually used in BaseViewManager for all views (once all the QEs settle)
2. We have reliable accessors for every setter, which seem to be what folks use externally for animation
3. We work consistently in CSS device independent pixels (for the most part...)
4. More structure/safety in how we refer to edges vs uniform
5. Overflow state is not kept on the applicator, so views can set/keep their own defaults
Overflow clipping must still be implemented per-view, during drawing unfortunately.
Changelog:
[Android][Added] - Add BackgroundStyleApplicator for managing view backgrounds
Reviewed By: joevilches
Differential Revision: D60252279
fbshipit-source-id: 4c6da3e128d4da94f35d50c30c7c412cb513cc12
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45734
Rather than enumerating all platforms the iOS podspec should not compile this inverts the source_files field to an allowlist for only files relevant to iOS.
## Changelog
[Internal]
Reviewed By: cipolleschi
Differential Revision: D60291091
fbshipit-source-id: a0f7e3181ec527e39602c4523622f836a04183d9
Summary:
Issue: https://github.com/facebook/react-native/issues/45596
## Changelog:
[INTERNAL] [CHANGED] - Migrate `GeneratePackageListTaskTest.kt` to AssertJ testing library
<!-- Help reviewers and the release process by writing your own changelog entry.
Pick one each for the category and type tags:
[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Pull Request resolved: https://github.com/facebook/react-native/pull/45790
Test Plan: Run `./gradlew -p packages/gradle-plugin test`
Reviewed By: sammy-SC
Differential Revision: D60382287
Pulled By: cortinico
fbshipit-source-id: 338c771db9d407f0d83e1c62a8c13ac26d898926
Summary:
`getGradleDependenciesToApply` tries to call `implementation:` in all libraries, including the ones that are not supported on Android.
## Changelog:
[INTERNAL] [FIXED] - Filter out platform-specific libraries from the auto-linking gradle plugin
Pull Request resolved: https://github.com/facebook/react-native/pull/45749
Test Plan: CI should be green
Reviewed By: cipolleschi
Differential Revision: D60374769
Pulled By: cortinico
fbshipit-source-id: 33c83e9cc39d81b0e5c497570a936831ebb345f9
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45708
# Changelog: [Internal]
This was originally highlighted by linter in D59975264, but I forgot to fix it.
Reviewed By: robhogan
Differential Revision: D60282937
fbshipit-source-id: 2869634f2d2111a5e2a81871b38b15a122b3ed8a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45528
Right now these exist in static view config (iOS BaseViewConfig), but not native view config, so the props don't work without bridgeless/SVCs, and we would get warnings if doing viewconfig validation.
This change adds the props to native view configs as well.
Changelog: [Internal]
Reviewed By: RSNara
Differential Revision: D59940432
fbshipit-source-id: 89d57d4e58de2a55b749c68274ef0d2271f69100
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45630
removeOutstandingSurfacesOnDestruction is safe to fully release, we are deleting the flag
changelog: [internal] internal
Reviewed By: sammy-SC
Differential Revision: D60142272
fbshipit-source-id: 5e7470d52cfc964b72f0cec7224a234ce9e6c2c4