1. Open your project explorer (this folder structure will not visible in Android explorer)
2. Create a new directory inside res folder name this new directory “layouts”. (This can be whatever you want)
3. create directory tree inside layouts folder (in my example i have created gallery inside layout and values, home ->layout and values, payment ->layout)
4. move your xml files into desired directory (inside layout folder) and delete the old layout folder
5. Add the following code in gradle file (app/build.gradle)
android { - - - - - - - - - - - - - - - - - - - - - - - - - - - sourceSets { main { res.srcDirs = [ 'src/main/res', 'src/main/res/layouts', 'src/main/res/layouts/gallery', 'src/main/res/layouts/home', 'src/main/res/layouts/paymet' ] } } - - - - - - - - - - - - - - - - }