Reputation: 86677
I'm using some layout files (default folder) that cannot be used in SDK < 11. I found that I can create a folder "layout-v10" etc, and place special layout files there.
I now want to make these files API 7 compatible. And likewise be used by all API 7-10. Do I have to create a new single folder for every api layout? Or how can I match every api that is below a specific to the alternative layout?
Upvotes: 2
Views: 393
Reputation: 234795
Reverse the logic: put the pre-11 layouts in res/layout and put the 11+ versions of the layouts in res/layout-v11.
Upvotes: 1
Reputation: 81349
Not exactly, but you can match every API above a specific version. For instance, you can have a layout-v7
folder and a layout-v11
folder. APIs 7 through 10 would use the resources from the first folder, APIs 11 and above from the later one. Pre API 7 versions would use the resources from the default layout
folder.
Upvotes: 5