Skip to content

This is a demo app for android that shows how to create nested resource directories using the gradle build system.

Notifications You must be signed in to change notification settings

rp181135198/ResourceNestingExample

 
 

Repository files navigation

ResourceNestingExample

This is a demo app for android that shows how to create nested resource directories using the gradle build system.

Screenshot

The trick to nesting resource folders is to use gradle's ability to merge multiple resource folders, and set the res folder as well as the nested subfolders in the sourceSets block.

The quirk is that you can't declare a container resource folder before you declare that folder's child resource folders.

Below is the sourceSets block from the build.gradle file. Notice that the subfolders are declared first.

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

About

This is a demo app for android that shows how to create nested resource directories using the gradle build system.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%