Open jorge-cab opened 2 days ago
This pull request was exported from Phabricator. Differential Revision: D65907786
This pull request was exported from Phabricator. Differential Revision: D65907786
This pull request was exported from Phabricator. Differential Revision: D65907786
Summary: 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 callbackLayerDrawable
in-place is not straightforward, I had to add a function that will figure out where each layer should be insertedLayerDrawable
doesn't allow deleting an element which means that for this case in particular we do need to re-createCompositeBackgroundDrawable
null
onLayerDrawable
layers, but older versions do not, this implementation is mostly done this way to accommodate older versions. But also, even though newer versions can havenull
set on a layerLayerDrawable
still doesn't handle it well and we get some bugs when removing and inserting a layerThis is all feature flagged. since it will only be enabled with the new drawables
Changelog: [Internal]
Differential Revision: D65907786