summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Flynn <flynn@google.com>2012-02-23 16:09:36 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-02-23 16:09:36 -0800
commitec63cd85c8b7f90a39e04aeec560fea7ea973b9a (patch)
treea0d6cd4ab85b327a15e8ea9bf9fef6d31fb4d4e8
parentc6e3f6f1a758a91d486cbcebb8241f8413c6e770 (diff)
parenta227a12314cbd019ba2ef621a66928f502ac64c7 (diff)
downloadframeworks_base-ec63cd85c8b7f90a39e04aeec560fea7ea973b9a.zip
frameworks_base-ec63cd85c8b7f90a39e04aeec560fea7ea973b9a.tar.gz
frameworks_base-ec63cd85c8b7f90a39e04aeec560fea7ea973b9a.tar.bz2
Merge "DO NOT MERGE Return 1.5 * density as default for large screens." into ics-scoop
-rw-r--r--core/java/android/app/ActivityManager.java18
1 files changed, 12 insertions, 6 deletions
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java
index 4fe9cef..a8ed132 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -1442,9 +1442,10 @@ public class ActivityManager {
public int getLauncherLargeIconDensity() {
final Resources res = mContext.getResources();
final int density = res.getDisplayMetrics().densityDpi;
+ final int sw = res.getConfiguration().smallestScreenWidthDp;
- if ((res.getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK)
- != Configuration.SCREENLAYOUT_SIZE_XLARGE) {
+ if (sw < 600) {
+ // Smaller than approx 7" tablets, use the regular icon size.
return density;
}
@@ -1458,7 +1459,9 @@ public class ActivityManager {
case DisplayMetrics.DENSITY_XHIGH:
return DisplayMetrics.DENSITY_MEDIUM * 2;
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() {
final Resources res = mContext.getResources();
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)
- != Configuration.SCREENLAYOUT_SIZE_XLARGE) {
+ if (sw < 600) {
+ // Smaller than approx 7" tablets, use the regular icon size.
return size;
}
@@ -1489,7 +1493,9 @@ public class ActivityManager {
case DisplayMetrics.DENSITY_XHIGH:
return (size * DisplayMetrics.DENSITY_MEDIUM * 2) / DisplayMetrics.DENSITY_XHIGH;
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);
}
}