mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
f22e6033d9
Summary: Adds functionality to RN's built-in version of the `getAndroidAssetSuffix` function. Open source uses a [fork of this code](https://github.com/react-native-community/cli/blob/df55a78f2d27e3443f15b15b87459b54a78e2c47/packages/cli/src/commands/bundle/assetPathUtils.ts#L19-L36) as part of the RN CLI and is therefore unaffected. Specifically, we can now package drawable assets for Android with nonstandard pixel densities by placing them in [`drawable-<nnn>dpi`](https://developer.android.com/guide/topics/resources/providing-resources#:~:text=nnndpi), where `nnn` is a number representing a pixel density. Previously using nonstandard scale factors like `1.25x` would be a build-time error when building for Android. We could send a corresponding PR to the RN CLI, but [Gradle doesn't support this convention](https://issuetracker.google.com/issues/72884435) (although it is documented and supported by Android) so it may not be of much use in OSS right away. Changelog: [Internal] Reviewed By: cortinico Differential Revision: D30784087 fbshipit-source-id: ea82f924d14a316702cabba759722cf26f69eb21