diff options
author | Michael Jurka <mikejurka@google.com> | 2011-08-05 15:08:15 -0700 |
---|---|---|
committer | Michael Jurka <mikejurka@google.com> | 2011-08-05 15:43:18 -0700 |
commit | 931dc9779dab5071efc21163647f5f004991bfb3 (patch) | |
tree | cd6053e947c1eaaab74d9efbeff6491200bbd931 /src/com/android/launcher2/LauncherModel.java | |
parent | 02765c94268d7dc3531c87a638a184a3b481ad40 (diff) | |
download | android_packages_apps_Trebuchet-931dc9779dab5071efc21163647f5f004991bfb3.tar.gz android_packages_apps_Trebuchet-931dc9779dab5071efc21163647f5f004991bfb3.tar.bz2 android_packages_apps_Trebuchet-931dc9779dab5071efc21163647f5f004991bfb3.zip |
Solving bug where labels were uneven
- Ensuring all icons, even those that are pulled from our database cache, are always the correct size
- Solves bug where loading icon for shortcuts with missing activities on a GB->ICS upgrade caused uneven labels (Bug 5111191)
Change-Id: I4b8a97c3b0fa02fd189f82d0c01444f47fee2205
Diffstat (limited to 'src/com/android/launcher2/LauncherModel.java')
-rw-r--r-- | src/com/android/launcher2/LauncherModel.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/android/launcher2/LauncherModel.java index 63e80775f..157348312 100644 --- a/src/com/android/launcher2/LauncherModel.java +++ b/src/com/android/launcher2/LauncherModel.java @@ -1511,7 +1511,7 @@ public class LauncherModel extends BroadcastReceiver { // the db if (icon == null) { if (c != null) { - icon = getIconFromCursor(c, iconIndex); + icon = getIconFromCursor(c, iconIndex, context); } } // the fallback icon @@ -1581,7 +1581,7 @@ public class LauncherModel extends BroadcastReceiver { } // the db if (icon == null) { - icon = getIconFromCursor(c, iconIndex); + icon = getIconFromCursor(c, iconIndex, context); } // the fallback icon if (icon == null) { @@ -1590,7 +1590,7 @@ public class LauncherModel extends BroadcastReceiver { } break; case LauncherSettings.Favorites.ICON_TYPE_BITMAP: - icon = getIconFromCursor(c, iconIndex); + icon = getIconFromCursor(c, iconIndex, context); if (icon == null) { icon = getFallbackIcon(); info.customIcon = false; @@ -1609,14 +1609,15 @@ public class LauncherModel extends BroadcastReceiver { return info; } - Bitmap getIconFromCursor(Cursor c, int iconIndex) { + Bitmap getIconFromCursor(Cursor c, int iconIndex, Context context) { if (false) { Log.d(TAG, "getIconFromCursor app=" + c.getString(c.getColumnIndexOrThrow(LauncherSettings.Favorites.TITLE))); } byte[] data = c.getBlob(iconIndex); try { - return BitmapFactory.decodeByteArray(data, 0, data.length); + return Utilities.createIconBitmap( + BitmapFactory.decodeByteArray(data, 0, data.length), context); } catch (Exception e) { return null; } |