Home > Software design >  Inside layout folder create multiple folder Android studio?
Inside layout folder create multiple folder Android studio?

Time:11-28

same xml file diffrent-diffrent folder

like activity-main.xml

 layout  ->
            first-page ->
                         activity_main.xml
                         activity_main2.xml
           seccond-page ->
                         activity_main.xml
                         activity_main2.xml
           third-page ->
                         activity_main.xml
                         activity_main2.xml
           fourth-page ->
                         activity_main.xml
                         activity_main2.xml         

CodePudding user response:

You can create a new folder inside the res directory. The new folder you create can be your res source.

Open app build.gradle file and add the following code:

sourceSets {
    main {
        res.srcDirs =
                [
                        'src/main/res/layouts/activities',
                        'src/main/res/layouts/fragements',
                        'src/main/res/layouts/includes',
                        'src/main/res/layouts/items',
                        'src/main/res/layouts',
                        'src/main/res'
                ]
    }
}

Repo link.

Enter image description here

  • Related