1

I have dozens of XML layouts that are used solely for the purpose of including them within other layouts.

I've tried creating a folder called includes under the layout directory, but that apparently doesn't work.

How then should I organize my include layouts? Where should I put them all?

user
  • 445
  • 1
  • 4
  • 8
  • 1
    the accepted answer to this question might help .. http://stackoverflow.com/questions/4930398/can-the-android-layout-folder-contain-subfolders .. its possible to use gradle to merge multiple layout folders together. – trooper Aug 23 '15 at 22:42
  • Are there other ways to organize include layouts? – user Aug 23 '15 at 22:44

1 Answers1

3

Sadly Android doesn't recognize itself different layouts folders. But with gradle you can configure several folders for your layouts (or other xmls)

Add the folders in your app gradle

sourceSets {
    main {
        res.srcDirs = ['src/main/res', 'src/main/res2']
    }
}
Aracem
  • 7,227
  • 4
  • 35
  • 72