Reputation: 2251
What kind of tablets get under layout-xlarge
and layout-sw720dp
folders?
For example 8" - 10" goes under layout-xlarge
folder. It's from documentation:
But what about layout-sw720dp
?
I know that If I haven't layout-xlarge
folder android will navigate 10" tablet to layout-sw720dp
, but what about 8" - 9" tablets ?
Android will choose layout
or layout-sw720dp
folder?
Upvotes: 2
Views: 2067
Reputation: 5803
layout-sw720dp
means devices with 720dp of smallest width. Specifically, the device's smallestWidth is the shortest of the screen's available height and width.
smallestWidth
Examples:sw320dp, sw600dp, sw720dp etc. The fundamental size of a screen, as indicated by the shortest dimension of the available screen area. Specifically, the device's smallestWidth is the shortest of the screen's available height and width (you may also think of it as the "smallest possible width" for the screen). You can use this qualifier to ensure that, regardless of the screen's current orientation, your application has at least dps of width available for its UI.
However if you use both layout-xlarge
and layout-sw720dp
in an app, the devices that qualifies both of them will always take from layout-sw720dp
. This is because of the higher precedence for sw<???>dp
qualifier. This is clearly specified in the docs which is linked above. If you have given multiple qualifier types for any resources, Android will search for qualifying folders in the order of precedences given to each type.
From the docs
Android supports several configuration qualifiers and you can add multiple qualifiers to one directory name, by separating each qualifier with a dash.
Table lists the valid configuration qualifiers, in order of precedence—if you use multiple qualifiers for a resource directory, you must add them to the directory name in the order they are listed in the table.
Upvotes: 3
Reputation: 3903
The configuration qualifiers you can use to provide size-specific resources are small, normal, large, and xlarge. For example, layouts for an extra-large screen should go in layout-xlarge/.
Beginning with Android 3.2 (API level 13), the above size groups are deprecated and you should instead use the swdp configuration qualifier to define the smallest available width required by your layout resources. For example, if your multi-pane tablet layout requires at least 600dp of screen width, you should place it in layout-sw600dp/. Using the new techniques for declaring layout resources is discussed further in the section about Declaring Tablet Layouts for Android 3.2.
Reference https://developer.android.com/guide/practices/screens_support.html
There are multiple folder as bellow you can read about them aswell
1)layout-sw480dp drawable-sw480dp
2)layout-sw600dp drawable-sw600dp
3)layout-sw720dp drawable-sw720dp
Upvotes: 1
Reputation: 8844
It will pick layout-sw720dp
folder. According to screen width it will first look for device width larger than 720dp
Upvotes: 2