Until now, storing all layout files in the layout folder has been easy to manage a small project. I feel the need for subfolders when the project is heavy and growing. For example,
layout
-- -- layout_personal
-- -- personal_detail.xml
-- -- personal_other.xml
--layout_address
-- -- address1.xml
-- -- address2.xml
Like this. Put the layout_personal and layout_address folders in the layout folder, and there is a personal-related layout and address-related layout in the layout folder, respectively. I'd like to keep a subfolder like this, what should I do?
android android-layout
This is possible with a gradient. https://github.com/eskimoapps/ResourceNestingExample This is a demo project. Go and refer to it.
Go to the gradle file
sourceSets {
main {
res.srcDirs =
[
'src/main/res/layouts/layouts_category2',
'src/main/res/layouts',
'src/main/res'
]
}
}
You can add the layout like this.
© 2024 OneMinuteCode. All rights reserved.