CopyPastor

Detecting plagiarism made easy.

Score: 1.6257638931274414; Reported for: String similarity, Exact paragraph match Open both answers

Possible Plagiarism

Plagiarized on 2016-08-17
by Zeeshan Khan

Original Post

Original - Posted on 2014-03-15
by eski



            
Present in both answers; Present only in the new answer; Present only in the old answer;

You Can do this with gradle
sourceSets { main { res.srcDirs = [ 'src/main/res/layouts/layouts_category2', 'src/main/res/layouts', 'src/main/res' ] } }
[![enter image description here][1]][1]

[1]: http://i.stack.imgur.com/dK7uj.png
You CAN do this with gradle. I've made a [demo project][4] showing how.
The trick is to use gradle's ability to [merge multiple resource folders][2], 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 from the demo. Notice that the subfolders are declared first.

sourceSets { main { res.srcDirs = [ 'src/main/res/layouts/layouts_category2', 'src/main/res/layouts', 'src/main/res' ] } }
![nested resources picture][1]
Also, the direct parent of your actual resource files (pngs, xml layouts, etc..) does still need to correspond with the [specification][3].

[1]: http://i.stack.imgur.com/yzj01.png [2]: http://tools.android.com/tech-docs/new-build-system/resource-merging [3]: https://developer.android.com/guide/topics/resources/providing-resources.html [4]: https://github.com/eskimoapps/ResourceNestingExample


        
Present in both answers; Present only in the new answer; Present only in the old answer;