Skip to content

Commit 73214f6

Browse files
Dianne HackbornAndroid (Google) Code Review
authored andcommitted
Merge "Fix launcher icon size for tvdpi." into jb-dev
2 parents 493f74e + d0356a1 commit 73214f6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

core/java/android/app/ActivityManager.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1687,6 +1687,8 @@ public int getLauncherLargeIconDensity() {
16871687
return DisplayMetrics.DENSITY_MEDIUM;
16881688
case DisplayMetrics.DENSITY_MEDIUM:
16891689
return DisplayMetrics.DENSITY_HIGH;
1690+
case DisplayMetrics.DENSITY_TV:
1691+
return DisplayMetrics.DENSITY_XHIGH;
16901692
case DisplayMetrics.DENSITY_HIGH:
16911693
return DisplayMetrics.DENSITY_XHIGH;
16921694
case DisplayMetrics.DENSITY_XHIGH:
@@ -1696,7 +1698,7 @@ public int getLauncherLargeIconDensity() {
16961698
default:
16971699
// The density is some abnormal value. Return some other
16981700
// abnormal value that is a reasonable scaling of it.
1699-
return (int)(density*1.5f);
1701+
return (int)((density*1.5f)+.5f);
17001702
}
17011703
}
17021704

@@ -1723,6 +1725,8 @@ public int getLauncherLargeIconSize() {
17231725
return (size * DisplayMetrics.DENSITY_MEDIUM) / DisplayMetrics.DENSITY_LOW;
17241726
case DisplayMetrics.DENSITY_MEDIUM:
17251727
return (size * DisplayMetrics.DENSITY_HIGH) / DisplayMetrics.DENSITY_MEDIUM;
1728+
case DisplayMetrics.DENSITY_TV:
1729+
return (size * DisplayMetrics.DENSITY_XHIGH) / DisplayMetrics.DENSITY_HIGH;
17261730
case DisplayMetrics.DENSITY_HIGH:
17271731
return (size * DisplayMetrics.DENSITY_XHIGH) / DisplayMetrics.DENSITY_HIGH;
17281732
case DisplayMetrics.DENSITY_XHIGH:
@@ -1732,7 +1736,7 @@ public int getLauncherLargeIconSize() {
17321736
default:
17331737
// The density is some abnormal value. Return some other
17341738
// abnormal value that is a reasonable scaling of it.
1735-
return (int)(size*1.5f);
1739+
return (int)((size*1.5f) + .5f);
17361740
}
17371741
}
17381742

0 commit comments

Comments
 (0)