react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Introduce "BoxShadowDrawable" for Android box shadows

Open NickGerleman opened this issue 1 year ago • 9 comments

Summary

This change adds a drawable, when when drawn on the bounds of a border-box sized view, will draw a spec compliant box-shadow outside the box. This is reliant on Android RenderNode and RenderEffect APIs provided by API 31.

Inset box shadows can also be added using a similar method, but this is not done yet.

The code which manages this is in flux, but the underlying drawable should be good. Will add some tests once it's more wired up.

Test Plan

Below applies a 5px black spread with a 10px blur to the purple view which includes a border radius. Other combinations of offsets, spreads, and blur radii were tested.

When I did this inside of the existing filters test (top has filter applied), it highlighted an issue of clipping content outside of filtered area, which will not be related directly to this change.

Changelog: [Internal]

Differential Revision: D55561465

NickGerleman avatar Mar 31 '24 01:03 NickGerleman

This pull request was exported from Phabricator. Differential Revision: D55561465

facebook-github-bot avatar Mar 31 '24 01:03 facebook-github-bot

This pull request was exported from Phabricator. Differential Revision: D55561465

facebook-github-bot avatar Apr 01 '24 23:04 facebook-github-bot

This pull request was exported from Phabricator. Differential Revision: D55561465

facebook-github-bot avatar Apr 02 '24 04:04 facebook-github-bot

This pull request was exported from Phabricator. Differential Revision: D55561465

facebook-github-bot avatar Apr 02 '24 05:04 facebook-github-bot

This pull request was exported from Phabricator. Differential Revision: D55561465

facebook-github-bot avatar Apr 02 '24 07:04 facebook-github-bot

This pull request was exported from Phabricator. Differential Revision: D55561465

facebook-github-bot avatar Apr 02 '24 12:04 facebook-github-bot

This pull request was exported from Phabricator. Differential Revision: D55561465

facebook-github-bot avatar Apr 02 '24 12:04 facebook-github-bot

This pull request was exported from Phabricator. Differential Revision: D55561465

facebook-github-bot avatar Apr 02 '24 13:04 facebook-github-bot

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 19,385,272 +11
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 22,760,270 +6
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 1b152f6ecada320602b45ea435f57e9ffc112932 Branch: main

analysis-bot avatar Apr 02 '24 14:04 analysis-bot

This pull request was exported from Phabricator. Differential Revision: D55561465

facebook-github-bot avatar Apr 08 '24 18:04 facebook-github-bot

This pull request was exported from Phabricator. Differential Revision: D55561465

facebook-github-bot avatar Apr 09 '24 01:04 facebook-github-bot

This pull request was exported from Phabricator. Differential Revision: D55561465

facebook-github-bot avatar Apr 13 '24 06:04 facebook-github-bot

This pull request has been merged in facebook/react-native@314a919df65a223cfa142b974b3db515f965e05e.

facebook-github-bot avatar Apr 13 '24 22:04 facebook-github-bot