Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d0356a19 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

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
parent 16fb5d44
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -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);
        }
    }