Just released a library for pretty-printing view hierarchies, and it supports composables too. Until LayoutInspector properly works with Compose, this might be helpful for debugging Compose apps. Feedback welcome!
Note that it doesn’t actually depend on a specific version of Compose, it tries to be somewhat flexible about supporting at least a few recent versions.
Github: https://github.com/square/radiography/
Blog: https://developer.squareup.com/blog/introducing-radiography/
Example output:
That's so cool!! Maybe this could be used for automatic 2-way conversion of design and compose code 🤔
k
Ketan
09/05/2020, 4:13 PM
Square always amaze developers with handy tools which accelerate the development.
z
Zach Klippenstein (he/him) [MOD]
09/05/2020, 10:19 PM
@caelum19 Not sure what you mean - could you elaborate?
c
caelum19
09/05/2020, 10:27 PM
@Zach Klippenstein (he/him) [MOD] in theory since you have the measurements and the types of views they are, it could be used to create designs that can be more easily experimented with tools like adobe xd, sketch and figma, could be handy for debugging and maybe even "actually living" designs that can be updated with the editor or designer
z
Zach Klippenstein (he/him) [MOD]
09/05/2020, 10:30 PM
This does sound like an interesting use case, but maybe something that would be better done by directly reading/modifying the slot table, which is ultimately where radiography gets this information.