Search code examples
androidandroid-studiointellij-idea

Difference between Editor Fold and Region comments in Android Studio


In Android Studio, there are two options for code folding:

  • Editor fold tag - <editor-fold desc="Description">
  • Region comment - //region Description

I used both for code folding, but I never understand - what is the difference between them?


Solution

  • The difference is in style. <editor-fold..> provides NetBeans folding style and region..endregion provides Visual Studio folding style.

    Note:

    You can only choose one of the styles for a particular file. No mixing should be done.