How to collapse/expand widget code region/area in Compose Android Studio like in XML

Issue

I have many Composables and I want to collapse Composable code inside like in xml. Is there extension for that?

Solution

Your post title is a bit misleading, but I think your’e asking how to collapse/expand "code" not the actual widget/ui.

I’m not sure if this is exactly what you want, but you can expand/collapse a specific area of your code if you wrap them within region/endregion without the need of any plugin or configuration, its almost the same behavior that your’e expecting from the xml editor, and you can do this anywhere not only to a function.

expanded code region

enter image description here

collapsed code region

enter image description here

Sample Inner composable expanded
enter image description here

Sample Inner composable collapsed
enter image description here

enter image description here

Answered By – z.y

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published