diff options
author | Winson Chung <winsonc@google.com> | 2013-10-13 22:46:20 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2013-10-13 22:46:20 -0700 |
commit | 0dbd734384df38960515ce49dfcb5e15a394deca (patch) | |
tree | 634a0c30be4fcb211333f506d1dca06b47ce0682 /src/com/android/launcher3/Utilities.java | |
parent | 01c0214f727a25088ec4d62e64579155001cef9b (diff) | |
download | android_packages_apps_Trebuchet-0dbd734384df38960515ce49dfcb5e15a394deca.tar.gz android_packages_apps_Trebuchet-0dbd734384df38960515ce49dfcb5e15a394deca.tar.bz2 android_packages_apps_Trebuchet-0dbd734384df38960515ce49dfcb5e15a394deca.zip |
Workaround for small icons. Draw icon drawables at the expected icon size. (Bug 11203738)
Change-Id: If976ae8b3603e8bf42e8e857ce0b178d977b0a43
Diffstat (limited to 'src/com/android/launcher3/Utilities.java')
-rw-r--r-- | src/com/android/launcher3/Utilities.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java index 2cb9314e1..fe8655029 100644 --- a/src/com/android/launcher3/Utilities.java +++ b/src/com/android/launcher3/Utilities.java @@ -66,6 +66,22 @@ final class Utilities { static int sColorIndex = 0; /** + * Returns a FastBitmapDrawable with the icon, accurately sized. + */ + static Drawable createIconDrawable(Bitmap icon) { + FastBitmapDrawable d = new FastBitmapDrawable(icon); + resizeIconDrawable(d); + return d; + } + + /** + * Resizes an icon drawable to the correct icon size. + */ + static void resizeIconDrawable(Drawable icon) { + icon.setBounds(0, 0, sIconTextureWidth, sIconTextureHeight); + } + + /** * Returns a bitmap suitable for the all apps view. Used to convert pre-ICS * icon bitmaps that are stored in the database (which were 74x74 pixels at hdpi size) * to the proper size (48dp) |