mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 01:16:49 +00:00
Enable to recreate icon with shadow without resizing it.
Change-Id: I808eec78ff221adee72d0395e87c89150693f206
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user