May 2022
Intermediate to advanced
688 pages
20h 12m
English
Android provides three qualifiers that allow you to test for the dimensions of the device. Table 18.1 shows these new qualifiers.
Table 18.1 Discrete screen dimension qualifiers
| Qualifier format | Description |
|---|---|
wXXXdp
|
available width: width greater than or equal to XXX dp |
hXXXdp
|
available height: height greater than or equal to XXX dp |
swXXXdp
|
smallest width: width or height (whichever is smaller) greater than or equal to XXX dp |
Let’s say that you wanted to specify a layout that would only be used if the display were at least 300dp wide. In that case, you could use an available width qualifier and put your layout file in res/layout-w300dp (the “w” is for ...
Read now
Unlock full access