Reputation: 9103
I'm developing an Android app that is capable of running on different screens, I'm using on of the approachs explained here which is:
res/layout/main_activity.xml # For handsets (smaller than 600dp available width)
res/layout-sw600dp/main_activity.xml # For 7” tablets (600dp wide and bigger)
res/layout-sw720dp/main_activity.xml # For 10” tablets (720dp wide and bigger)
I know that the Layout
folder is the default one that the app goes to when not finding the desired layout in the specified folder, but I want to ask if I've like Two Layouts (layout_A
& layout_B
) and layout_A
is differ from one case to another of the mentioned three cases(handset, 7', 10') so that it will be exist in the three folders, but the layout_B
is differ from handset to 7' but is the same from 7' to 10', am i suppose to copy/paste it from the 600dp
folder to the 720dp
folder ?(as if the layout folder is the default as always) , or it's enough to put in the 600dp
folder and it will be accessed from there in the case of 720dp
?.
ie. if I've the Layouts folders as the following:
layout/layout_A.xml //A1
/layout_B.xml //B1
layout-sw600dp/layout_A.xml //A2
/layout_B.xml //B2
layout-sw720dp/layout_A.xml //A3
And now I'm trying to run layout_B.xml
on a 10' tablet, what's the layout that my app will pick ?(B1 || B2)?
Upvotes: 1
Views: 299
Reputation: 20112
As I understand the configuration examples it would work if you put your Layout_B
only inside the res/layout-sw600dp/
folder and it will be used by a 720dp
device as well, because the sw
means "smallest width" and a 720dp device provides the requested minimum of 600dp (and extends this requirement by additional 120dp), which means in your case the app will pick B2 for the 10' tablet.
Testing both configurations will make this sure in a minute.
Upvotes: 1