Android: structuring layout files (e.g. as in subfolders)

Is there a way to structure layout files, for example. like in subfolders (since resource subfolders are not supported)?

I have many layout files that all lie in the layout folder. It's beautiful

Is there any way to structure them, by tags, subfolders or something else?

EG:

  • layout
    • screen A
    • screen B

or

  • layout
    • Fragments
    • Activities

or

  • layout
    • component A
    • component B
+5
source share
1 answer

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

It allows you to organize not only your layout files, but also any resources .

This is what the configuration looks like:

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

Documentation

Project example

+1
source

All Articles