summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Dianne Hackborn <hackbod@google.com> 2012-04-26 19:03:12 -0700
committer Dianne Hackborn <hackbod@google.com> 2012-04-26 19:03:12 -0700
commitd0356a19c1630e598a096477ce5cb5d2942a9405 (patch)
treed7f93cad41a2f627d7184ec5c73cf051ee591bc5
parent16fb5d444cea1c978257807910b96d4e47b78dce (diff)
Fix launcher icon size for tvdpi.
We didn't have a case for tvdpi, so ended up in the default scaling. This resulting in us using 319 instead of 320. Fixed the default case to round, and added explicit cases for tvdpi since this is a standard density. Change-Id: I752b924e1556af94682428c8c0ed7c75d15ac4a4
-rw-r--r--core/java/android/app/ActivityManager.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java
index 7dce2d3d9950..7746ca9aec23 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -1687,6 +1687,8 @@ public class ActivityManager {
return DisplayMetrics.DENSITY_MEDIUM;
case DisplayMetrics.DENSITY_MEDIUM:
return DisplayMetrics.DENSITY_HIGH;
+ case DisplayMetrics.DENSITY_TV:
+ return DisplayMetrics.DENSITY_XHIGH;
case DisplayMetrics.DENSITY_HIGH:
return DisplayMetrics.DENSITY_XHIGH;
case DisplayMetrics.DENSITY_XHIGH:
@@ -1696,7 +1698,7 @@ public class ActivityManager {
default:
// The density is some abnormal value. Return some other
// abnormal value that is a reasonable scaling of it.
- return (int)(density*1.5f);
+ return (int)((density*1.5f)+.5f);
}
}
@@ -1723,6 +1725,8 @@ public class ActivityManager {
return (size * DisplayMetrics.DENSITY_MEDIUM) / DisplayMetrics.DENSITY_LOW;
case DisplayMetrics.DENSITY_MEDIUM:
return (size * DisplayMetrics.DENSITY_HIGH) / DisplayMetrics.DENSITY_MEDIUM;
+ case DisplayMetrics.DENSITY_TV:
+ return (size * DisplayMetrics.DENSITY_XHIGH) / DisplayMetrics.DENSITY_HIGH;
case DisplayMetrics.DENSITY_HIGH:
return (size * DisplayMetrics.DENSITY_XHIGH) / DisplayMetrics.DENSITY_HIGH;
case DisplayMetrics.DENSITY_XHIGH:
@@ -1732,7 +1736,7 @@ public class ActivityManager {
default:
// The density is some abnormal value. Return some other
// abnormal value that is a reasonable scaling of it.
- return (int)(size*1.5f);
+ return (int)((size*1.5f) + .5f);
}
}