DO NOT MERGE
Revert "Add xxhdpi; fix ActivityManager.getLauncherLargeIconSize() etc."
This reverts commit c1496d2d9a.
Change-Id: If60df742b19c925cc99b20d01108b84415b124ad
This commit is contained in:
committed by
Android Git Automerger
parent
e6a0ec6060
commit
5e7bb1e675
@@ -21389,7 +21389,6 @@ package android.util {
|
|||||||
field public static final int DENSITY_MEDIUM = 160; // 0xa0
|
field public static final int DENSITY_MEDIUM = 160; // 0xa0
|
||||||
field public static final int DENSITY_TV = 213; // 0xd5
|
field public static final int DENSITY_TV = 213; // 0xd5
|
||||||
field public static final int DENSITY_XHIGH = 320; // 0x140
|
field public static final int DENSITY_XHIGH = 320; // 0x140
|
||||||
field public static final int DENSITY_XXHIGH = 480; // 0x1e0
|
|
||||||
field public float density;
|
field public float density;
|
||||||
field public int densityDpi;
|
field public int densityDpi;
|
||||||
field public int heightPixels;
|
field public int heightPixels;
|
||||||
|
|||||||
@@ -1442,10 +1442,9 @@ public class ActivityManager {
|
|||||||
public int getLauncherLargeIconDensity() {
|
public int getLauncherLargeIconDensity() {
|
||||||
final Resources res = mContext.getResources();
|
final Resources res = mContext.getResources();
|
||||||
final int density = res.getDisplayMetrics().densityDpi;
|
final int density = res.getDisplayMetrics().densityDpi;
|
||||||
final int sw = res.getConfiguration().smallestScreenWidthDp;
|
|
||||||
|
|
||||||
if (sw < 600) {
|
if ((res.getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK)
|
||||||
// Smaller than approx 7" tablets, use the regular icon size.
|
!= Configuration.SCREENLAYOUT_SIZE_XLARGE) {
|
||||||
return density;
|
return density;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1457,13 +1456,9 @@ public class ActivityManager {
|
|||||||
case DisplayMetrics.DENSITY_HIGH:
|
case DisplayMetrics.DENSITY_HIGH:
|
||||||
return DisplayMetrics.DENSITY_XHIGH;
|
return DisplayMetrics.DENSITY_XHIGH;
|
||||||
case DisplayMetrics.DENSITY_XHIGH:
|
case DisplayMetrics.DENSITY_XHIGH:
|
||||||
return DisplayMetrics.DENSITY_XXHIGH;
|
return DisplayMetrics.DENSITY_MEDIUM * 2;
|
||||||
case DisplayMetrics.DENSITY_XXHIGH:
|
|
||||||
return DisplayMetrics.DENSITY_XHIGH * 2;
|
|
||||||
default:
|
default:
|
||||||
// The density is some abnormal value. Return some other
|
return density;
|
||||||
// abnormal value that is a reasonable scaling of it.
|
|
||||||
return (int)(density*1.5f);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1476,10 +1471,9 @@ public class ActivityManager {
|
|||||||
public int getLauncherLargeIconSize() {
|
public int getLauncherLargeIconSize() {
|
||||||
final Resources res = mContext.getResources();
|
final Resources res = mContext.getResources();
|
||||||
final int size = res.getDimensionPixelSize(android.R.dimen.app_icon_size);
|
final int size = res.getDimensionPixelSize(android.R.dimen.app_icon_size);
|
||||||
final int sw = res.getConfiguration().smallestScreenWidthDp;
|
|
||||||
|
|
||||||
if (sw < 600) {
|
if ((res.getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK)
|
||||||
// Smaller than approx 7" tablets, use the regular icon size.
|
!= Configuration.SCREENLAYOUT_SIZE_XLARGE) {
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1493,13 +1487,9 @@ public class ActivityManager {
|
|||||||
case DisplayMetrics.DENSITY_HIGH:
|
case DisplayMetrics.DENSITY_HIGH:
|
||||||
return (size * DisplayMetrics.DENSITY_XHIGH) / DisplayMetrics.DENSITY_HIGH;
|
return (size * DisplayMetrics.DENSITY_XHIGH) / DisplayMetrics.DENSITY_HIGH;
|
||||||
case DisplayMetrics.DENSITY_XHIGH:
|
case DisplayMetrics.DENSITY_XHIGH:
|
||||||
return (size * DisplayMetrics.DENSITY_XXHIGH) / DisplayMetrics.DENSITY_XHIGH;
|
return (size * DisplayMetrics.DENSITY_MEDIUM * 2) / DisplayMetrics.DENSITY_XHIGH;
|
||||||
case DisplayMetrics.DENSITY_XXHIGH:
|
|
||||||
return (size * DisplayMetrics.DENSITY_XHIGH*2) / DisplayMetrics.DENSITY_XXHIGH;
|
|
||||||
default:
|
default:
|
||||||
// The density is some abnormal value. Return some other
|
return size;
|
||||||
// abnormal value that is a reasonable scaling of it.
|
|
||||||
return (int)(size*1.5f);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -56,13 +56,6 @@ public class DisplayMetrics {
|
|||||||
*/
|
*/
|
||||||
public static final int DENSITY_XHIGH = 320;
|
public static final int DENSITY_XHIGH = 320;
|
||||||
|
|
||||||
/**
|
|
||||||
* Standard quantized DPI for extra-extra-high-density screens. Applications
|
|
||||||
* should not generally worry about this density; relying on XHIGH graphics
|
|
||||||
* being scaled up to it should be sufficient for almost all cases.
|
|
||||||
*/
|
|
||||||
public static final int DENSITY_XXHIGH = 480;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The reference density used throughout the system.
|
* The reference density used throughout the system.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -843,8 +843,6 @@ struct ResTable_config
|
|||||||
DENSITY_MEDIUM = ACONFIGURATION_DENSITY_MEDIUM,
|
DENSITY_MEDIUM = ACONFIGURATION_DENSITY_MEDIUM,
|
||||||
DENSITY_TV = ACONFIGURATION_DENSITY_TV,
|
DENSITY_TV = ACONFIGURATION_DENSITY_TV,
|
||||||
DENSITY_HIGH = ACONFIGURATION_DENSITY_HIGH,
|
DENSITY_HIGH = ACONFIGURATION_DENSITY_HIGH,
|
||||||
DENSITY_XHIGH = ACONFIGURATION_DENSITY_XHIGH,
|
|
||||||
DENSITY_XXHIGH = ACONFIGURATION_DENSITY_XXHIGH,
|
|
||||||
DENSITY_NONE = ACONFIGURATION_DENSITY_NONE
|
DENSITY_NONE = ACONFIGURATION_DENSITY_NONE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -42,8 +42,6 @@ enum {
|
|||||||
ACONFIGURATION_DENSITY_MEDIUM = 160,
|
ACONFIGURATION_DENSITY_MEDIUM = 160,
|
||||||
ACONFIGURATION_DENSITY_TV = 213,
|
ACONFIGURATION_DENSITY_TV = 213,
|
||||||
ACONFIGURATION_DENSITY_HIGH = 240,
|
ACONFIGURATION_DENSITY_HIGH = 240,
|
||||||
ACONFIGURATION_DENSITY_XHIGH = 320,
|
|
||||||
ACONFIGURATION_DENSITY_XXHIGH = 480,
|
|
||||||
ACONFIGURATION_DENSITY_NONE = 0xffff,
|
ACONFIGURATION_DENSITY_NONE = 0xffff,
|
||||||
|
|
||||||
ACONFIGURATION_KEYBOARD_ANY = 0x0000,
|
ACONFIGURATION_KEYBOARD_ANY = 0x0000,
|
||||||
|
|||||||
@@ -1079,17 +1079,12 @@ bool AaptGroupEntry::getDensityName(const char* name,
|
|||||||
if (out) out->density = ResTable_config::DENSITY_HIGH;
|
if (out) out->density = ResTable_config::DENSITY_HIGH;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(name, "xhdpi") == 0) {
|
if (strcmp(name, "xhdpi") == 0) {
|
||||||
if (out) out->density = ResTable_config::DENSITY_XHIGH;
|
if (out) out->density = ResTable_config::DENSITY_MEDIUM*2;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(name, "xxhdpi") == 0) {
|
|
||||||
if (out) out->density = ResTable_config::DENSITY_XXHIGH;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
char* c = (char*)name;
|
char* c = (char*)name;
|
||||||
while (*c >= '0' && *c <= '9') {
|
while (*c >= '0' && *c <= '9') {
|
||||||
c++;
|
c++;
|
||||||
|
|||||||
Reference in New Issue
Block a user