diff options
author | Mario Bertschler <bmario@google.com> | 2017-07-10 12:28:48 -0700 |
---|---|---|
committer | Mario Bertschler <bmario@google.com> | 2017-07-10 12:36:31 -0700 |
commit | 080c37ecc18e6cd80bc5a1411edb0ebfe69cffa1 (patch) | |
tree | d0ebdccbef6448633a6ffa27163e10c5adb3bd46 /src/com/android/launcher3/graphics/ShadowGenerator.java | |
parent | 6c5d10261eceaf1b57bce82e4e31d272bad2c349 (diff) | |
download | android_packages_apps_Trebuchet-080c37ecc18e6cd80bc5a1411edb0ebfe69cffa1.tar.gz android_packages_apps_Trebuchet-080c37ecc18e6cd80bc5a1411edb0ebfe69cffa1.tar.bz2 android_packages_apps_Trebuchet-080c37ecc18e6cd80bc5a1411edb0ebfe69cffa1.zip |
Enable to recreate icon with shadow without resizing it.
Change-Id: I808eec78ff221adee72d0395e87c89150693f206
Diffstat (limited to 'src/com/android/launcher3/graphics/ShadowGenerator.java')
-rw-r--r-- | src/com/android/launcher3/graphics/ShadowGenerator.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/com/android/launcher3/graphics/ShadowGenerator.java b/src/com/android/launcher3/graphics/ShadowGenerator.java index fffea8e3e..3c71c3acc 100644 --- a/src/com/android/launcher3/graphics/ShadowGenerator.java +++ b/src/com/android/launcher3/graphics/ShadowGenerator.java @@ -63,9 +63,15 @@ public class ShadowGenerator { } public synchronized Bitmap recreateIcon(Bitmap icon) { + return recreateIcon(icon, true); + } + + public synchronized Bitmap recreateIcon(Bitmap icon, boolean resize) { + int width = resize ? mIconSize : icon.getWidth(); + int height = resize ? mIconSize : icon.getHeight(); int[] offset = new int[2]; Bitmap shadow = icon.extractAlpha(mBlurPaint, offset); - Bitmap result = Bitmap.createBitmap(mIconSize, mIconSize, Config.ARGB_8888); + Bitmap result = Bitmap.createBitmap(width, height, Config.ARGB_8888); mCanvas.setBitmap(result); // Draw ambient shadow |