With the growth of the project in the folder layouts accumulated a large number of files with markup. This naturally causes some inconvenience.
Can they be grouped into subfolders in any way?
You can follow these steps one by one:
res
called "layouts".At last add this to your build.gradle
which declares where all the resources are located at:
android {
...
defaultConfig {
...
}
buildTypes {
...
}
sourceSets {
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
java.srcDirs = ['src/main/java', 'apt_generated']
aidl.srcDirs = ['src/main.aidl', 'apt_generated']
assets.srcDirs = ['src/main/assets']
res.srcDirs =
[
'src/main/res/layout/main-activity',
'src/main/res/layout/adapter',
'src/main/res'
]
}
}
}
Notice! src/main/res/layouts
MUST be second last and src/main/res
MUST be the last path
Also, switch to Project
perspective to work.