ResourceQualifier sizeQ = mQualifiers[INDEX_SCREEN_DIMENSION];
ResourceQualifier densityQ = mQualifiers[INDEX_PIXEL_DENSITY];
ResourceQualifier orientQ = mQualifiers[INDEX_SCREEN_ORIENTATION];
if (sizeQ != null && densityQ != null && orientQ != null) {
Density density = ((DensityQualifier) densityQ).getValue();
if (density == Density.NODPI) {
return;
}
ScreenOrientation orientation = ((ScreenOrientationQualifier) orientQ).getValue();
int size1 = ((ScreenDimensionQualifier) sizeQ).getValue1();
int size2 = ((ScreenDimensionQualifier) sizeQ).getValue2();
// make sure size1 is the biggest (should be the case, but make sure)
if (size1 < size2) {
int a = size1;
size1 = size2;
size2 = a;
}
// compute the dp. round them up since we want -w480dp to match a 480.5dp screen
int dp1 = (int) Math.ceil(size1 * Density.DEFAULT_DENSITY / density.getDpiValue());
int dp2 = (int) Math.ceil(size2 * Density.DEFAULT_DENSITY / density.getDpiValue());
setSmallestScreenWidthQualifier(new SmallestScreenWidthQualifier(dp2));
switch (orientation) {
case PORTRAIT: