Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is their a "region-like" folding feature for Android Studio

Tags:

I'm developing on Android Studio and as others IDE, Android Studio has a feature to create "regions" in the java code that can be folded. (see below)

With this kind of code

//region INITIALIZATION private int myVaribale; private String otherVariblae; //endregion 

We can fold/unfold the code (see screenshots below).

Unfolded code

Folded code

Is their something similar for XML editors (specially the one in Android Studio) ?

Something where we can add for example :

<!-- region MY LAYOUTS --> <RelativeLayout>     //Some layouts  </RelativeLayout> <!-- endregion --> 
like image 951
MHogge Avatar asked Aug 29 '16 12:08

MHogge


2 Answers

You can now do this:

<!--region Title--> <View     android:layout_width="wrap_content"     android:layout_height="wrap_content"/> <!--endregion--> 

(I'm using Android Studio 3.0 and not sure when it was supported)

like image 155
Gary McGowan Avatar answered Dec 18 '22 19:12

Gary McGowan


You can simply achieve this by

//region name ~~~Code~~~ //endregion 

Check it out this link for more info. Create Regions in Android Studio

like image 22
Danish Amjad Avatar answered Dec 18 '22 19:12

Danish Amjad