In the Android SDK documentation, all of the examples used with the @drawable/my_image xml syntax directly address images that are stored in the res/drawable directory in my
Gradle with Android Studio could do it this way (link).
It's in the paragraph "Configuring the Structure"
sourceSets {
main {
java {
srcDir 'src/java'
}
resources {
srcDir 'src/resources'
}
}
}
Actually, on Android Studio it is possible. You can have nested resources as shown here :
There is also a plugin to group resources here.
I recommend to avoid this though.
Yes - it does suck :) However you can use the assets folder and have sub directories in there and load images that way.
Check Bash Flatten Folder script that converts folder hierarchy to a single folder
With the advent of library system, creating a library per big set of assets could be a solution.
It is still problematic as one must avoid using the same names within all the assets but using a prefix scheme per library should help with that.
It's not as simple as being able to create folders but that helps keeping things sane...
There is a workaround for this situation: you can create a resVector
(for example) folder on the same level as default res
folder. There you can add any drawable-xxx
resource folders there:
resVector
-drawable
-layout
-color
After that all you need is to add
sourceSets {
main.res.srcDirs += 'src/main/resVector'
}
into your build.gradle
file (inside android { }
).