1

I have android project where I am using lots of layout as common resources in other activity layouts. for example, I have a layout for headers , which I include in 4 activity layouts for visual consistency. Since I have lots of common layouts created, my layout folder is very cluttered. I was looking for a way to package them separately. What I wanted to do is to create another sub-folder inside the layout folder and put all the shared resources there like :

under res folder

layout(folder)
  --activity_home.xml
  --other_activity.xml

  --common ( folder)
    --header_layout.xml
    --other_shared_layouts.xml

From this link in SO, I found that its not supported in android which was answered 4 years ago. It mentions that, gradle can resolve this issue by proper mergings, but I would prefer other options if there are any. I was wondering if there are any other ways to handle this scenario? I am just trying to organize the layouts file so that they don't clutter in one folder. Is gradle the ONLY way to go ?

This is my SDK details if that matters .

<uses-sdk
        android:minSdkVersion="15"
        android:targetSdkVersion="21" />

Thanks in advance for any kind of input.

Community
  • 1
  • 1
Jimmy
  • 2,589
  • 21
  • 31
  • Possible duplicate of [Can the Android Layout folder contain subfolders?](https://stackoverflow.com/questions/4930398/can-the-android-layout-folder-contain-subfolders) – Archit Sureja Dec 28 '17 at 09:56
  • The question itself acknowledges the link, but why bother reading all the question right ? – Jimmy Dec 28 '17 at 15:16

1 Answers1

3

This is still unsupported. Android studio's Android scoping looks slightly better.

localhost
  • 5,568
  • 1
  • 33
  • 53