It is called
Folding in Android Studio.
First make sure it is enabled in config (it should be by default). Go to
Settings, then under the
IDE Settings area find
Editor -> General -> Code Folding, check the
Show code folding outline.
To collapse/expand items use the
To customize the keyboard shortcuts for these open Settings (
Settings) then select
IDE Settings. Now type
folding into the search box (top right). Setup the keyboard shortcut for the various folding actions 🙂
Minimize: CTRL + SHFT + '-' Expand: CTRL + SHFT + '+'
Minimize: COMM + SHFT + '-' Expand: COMM + SHFT + '+'
Here’s screenshot for quick reference: