5

Is there a way to structure layout files, e.g. like in subfolders (as subfolders of resources are not supported)?

I have many layout files which all lie in the layout folder. This gets pretty

is it possible to somehow structure them, by tags, by subfolders or something else?

E.G.:

  • layout
    • screen A
    • screen B

or

  • layout
    • fragments
    • activities

or

  • layout
    • component A
    • component B
McOzD
  • 181
  • 1
  • 1
  • 10

1 Answers1

1

Yes, you can have multiple resource folders in your project using Gradle.

It allows you to organize not only your layout files but any kind of resources.

This is how the configuration looks like:

sourceSets {
    main {
        res.srcDirs = ['src/main/res', 'src/main/res2']
    }
}

Documentation

Example Project

Machado
  • 14,105
  • 13
  • 56
  • 97