mirror of
https://github.com/facebook/react-native.git
synced 2024-11-21 20:50:09 +00:00
61f01ade42
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/47618 Its not optimal to reconstruct CompositeBackgroundDrawable everytime we add a layer to it. With this change I'm adding an optimization to modify the underlying `LayerDrawable` in place instead of reconstructing everything. `LayerDrawable` has a pretty constrained API and some weirdish behaviors. - `addLayer` - This API doesnt set the callback for the recently added layer so after adding the layer we also need to manually set the callback - Mutating `LayerDrawable` in-place is not straightforward, I had to add a function that will figure out where each layer should be inserted - `LayerDrawable` doesn't allow deleting an element which means that for this case in particular we do need to re-create `CompositeBackgroundDrawable` - Newer Android versions allow `null` on `LayerDrawable` layers, but older versions do not, this implementation is mostly done this way to accommodate older versions. But also, even though newer versions can have `null` set on a layer `LayerDrawable` still doesn't handle it well and we get some bugs when removing and inserting a layer which the current implementation handles by not relying on null This is all feature flagged. since it will only be enabled with the new drawables Changelog: [Internal] Reviewed By: joevilches Differential Revision: D65907786 fbshipit-source-id: c18b898ddfe58faa5b90714945ffcc82d471051d |
||
---|---|---|
.. | ||
assets | ||
babel-plugin-codegen | ||
community-cli-plugin | ||
core-cli-utils | ||
debugger-frontend | ||
dev-middleware | ||
eslint-config-react-native | ||
eslint-plugin-react-native | ||
eslint-plugin-specs | ||
gradle-plugin | ||
helloworld | ||
hermes-inspector-msggen | ||
metro-config | ||
normalize-color | ||
polyfills | ||
react-native | ||
react-native-babel-preset | ||
react-native-babel-transformer | ||
react-native-bots | ||
react-native-codegen | ||
react-native-codegen-typescript-test | ||
react-native-info | ||
react-native-popup-menu-android | ||
react-native-test-library | ||
react-native-test-renderer | ||
rn-tester | ||
typescript-config | ||
virtualized-lists |