Merge "DO NOT MERGE Return 1.5 * density as default for large screens." into ics-scoop

This commit is contained in:
Andrew Flynn
2012-02-23 16:09:36 -08:00
committed by Android (Google) Code Review

View File

@@ -1442,9 +1442,10 @@ 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 ((res.getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) if (sw < 600) {
!= Configuration.SCREENLAYOUT_SIZE_XLARGE) { // Smaller than approx 7" tablets, use the regular icon size.
return density; return density;
} }
@@ -1458,7 +1459,9 @@ public class ActivityManager {
case DisplayMetrics.DENSITY_XHIGH: case DisplayMetrics.DENSITY_XHIGH:
return DisplayMetrics.DENSITY_MEDIUM * 2; return DisplayMetrics.DENSITY_MEDIUM * 2;
default: default:
return density; // The density is some abnormal value. Return some other
// abnormal value that is a reasonable scaling of it.
return (int)(density*1.5f);
} }
} }
@@ -1471,9 +1474,10 @@ 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 ((res.getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) if (sw < 600) {
!= Configuration.SCREENLAYOUT_SIZE_XLARGE) { // Smaller than approx 7" tablets, use the regular icon size.
return size; return size;
} }
@@ -1489,7 +1493,9 @@ public class ActivityManager {
case DisplayMetrics.DENSITY_XHIGH: case DisplayMetrics.DENSITY_XHIGH:
return (size * DisplayMetrics.DENSITY_MEDIUM * 2) / DisplayMetrics.DENSITY_XHIGH; return (size * DisplayMetrics.DENSITY_MEDIUM * 2) / DisplayMetrics.DENSITY_XHIGH;
default: default:
return size; // The density is some abnormal value. Return some other
// abnormal value that is a reasonable scaling of it.
return (int)(size*1.5f);
} }
} }