Organize layout files in Android studio

2

Next,

I have a project that in the end will be huge. Currently I have finished 1 module from a total of 4 modules and it is already full of layouts, etc. Here's an image for you to know about the file you have:

And there are still a lot more layouts down below ...

Anyway, I'd like to separate everything inside this res / layout inside subfolders. is it possible?

    
asked by anonymous 22.12.2017 / 17:09

1 answer

4

You can do this with Gradle at a look at this sample project

Here is an example of the block in the build.gradle file of the sample project, the subfolders are declared before.

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

Ihopethathelpsyou.

Font: stackoverflow.com

    
22.12.2017 / 17:24