`showLayoutBounds` is supported within compose but it is integrated deep inside the UI core. I wonde...
m
showLayoutBounds
is supported within compose but it is integrated deep inside the UI core. I wonder if it is possible to create something like this on my own without tampering with the core. For example, by some modifier which adds some behavior to all subsequent composables.
a
No, we've avoided this as it would open a Pandora's box of being able to break library components in broad ways, and encourage integrators to file bugs to library component authors when using this feature breaks otherwise valid and correct library code
Views had a number of ways to do this sort of thing via themes and the above scenario was the result
It caused fragility in components like date pickers that were built using composition of elements as internal implementation details that could be externally styled in ways that broke the date picker's specified layout
At best it meant that integrators started expecting the use of specific implementation details that they took time to try to style externally
And migrations to different implementation details later led to frustration when those expectations were broken
m
Thanks for explanation. Any plans to create something like
Show view updates
that would show some color indication that Component was recomposed? It would be useful for performance improvements.
a
yes, as you've seen it works out of the box if you turn on the normal android developer option, but we're also looking into other visualizations of recomposition behavior
one big one on my mind is that a
@Composable fun
is often not 1-1 with an on-screen layout element, so definitively visualizing those is an interesting question. I could see flashing blocks of code in the editor as opposed to the visual elements in the actual app UI, for example