1. 打開android studio
2. 選擇要折疊的代碼
3. 按Ctrl + Alt + T 選擇 “region .. end region comments”
4. 代碼已被 “//region” / “//endregion” 包圍, 可以看到代碼可以折疊了
5. You can now edit the description of your group
6. You can easily see the code within your group without having to expand the group, just hover the group description with the mouse pointer
來源: