Bug 714975 - [ICS] Home Screen icons are too small on ICS [r=wesj]

This commit is contained in:
Mark Finkle 2012-01-04 15:52:22 -05:00
Родитель 4de2640aa7
Коммит df5ed7528b
1 изменённых файлов: 17 добавлений и 5 удалений

Просмотреть файл

@ -660,12 +660,24 @@ public class GeckoAppShell
}
static private Bitmap getLauncherIcon(Bitmap aSource) {
// The background images are 72px, but Android will resize as needed.
// Bigger is better than too small.
final int kIconSize = 72;
final int kOverlaySize = 32;
final int kOffset = 6;
final int kRadius = 5;
int kIconSize;
int kOverlaySize;
switch (getDpi()) {
case DisplayMetrics.DENSITY_MEDIUM:
kIconSize = 48;
kOverlaySize = 32;
break;
case DisplayMetrics.DENSITY_XHIGH:
kIconSize = 96;
kOverlaySize = 48;
break;
case DisplayMetrics.DENSITY_HIGH:
default:
kIconSize = 72;
kOverlaySize = 32;
}
Bitmap bitmap = Bitmap.createBitmap(kIconSize, kIconSize, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
@ -690,7 +702,7 @@ public class GeckoAppShell
// draw the overlay
Bitmap overlay = BitmapFactory.decodeResource(GeckoApp.mAppContext.getResources(), R.drawable.home_bg);
canvas.drawBitmap(overlay, null, new Rect(0,0,kIconSize, kIconSize), null);
canvas.drawBitmap(overlay, null, new Rect(0, 0, kIconSize, kIconSize), null);
// draw the bitmap
if (aSource == null)