In Android Studio 3.6.1. (Java 8) there are multiple options for folding (Code -> Folding
):
Collapse
- Collapses the code block the cursor is in, if I put it at the start of a method, it only collapses that but not the if
, for
, whatever else inside.Collapse Recursively
- Collapses the code block the cursor is in but also all the if
, for
, //
... inside.Collapse All
- Works like Collapse Recursively
but collapses all the functions in the file, so it's actually a "Collapse All Rescursively".Using the third option in a file with a lot of methods/code blocks, if I just want to work on a single method, means that I have to unfold everything inside that code block again.
I know that Eclipse and Visual Studio are able to fold all methods non-recursively (my shortcuts there are: Ctrl + Shift + Numpad / for folding and Ctrl + Shift + Numpad * for unfolding) but how do I do the same thing in Android Studio?
Unfortunately it appears this can't be done. The best way to deal with this that I've found is to expand the desired method recursively with ctrl alt +
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With