Prevent clipping on the top and left side on AdaptiveIconDrawables

b/62372639

Change-Id: I0b2c0daecba2904f3e89f7b0b558d9b10f5dcbf6
This commit is contained in:
Hyunyoung Song
2017-06-06 12:12:22 -07:00
parent 0270039b98
commit 9279496e54
2 changed files with 4 additions and 3 deletions
@@ -266,9 +266,10 @@ public class LauncherIcons {
sOldBounds.set(icon.getBounds());
if (Utilities.isAtLeastO() && icon instanceof AdaptiveIconDrawable) {
int offset = Math.min(left, top);
int offset = Math.max((int)(ShadowGenerator.BLUR_FACTOR * iconBitmapSize),
Math.min(left, top));
int size = Math.max(width, height);
icon.setBounds(offset, offset, offset + size, offset + size);
icon.setBounds(offset, offset, size, size);
} else {
icon.setBounds(left, top, left+width, top+height);
}
@@ -35,7 +35,7 @@ public class ShadowGenerator {
// Percent of actual icon size
private static final float HALF_DISTANCE = 0.5f;
private static final float BLUR_FACTOR = 0.5f/48;
public static final float BLUR_FACTOR = 0.5f/48;
// Percent of actual icon size
private static final float KEY_SHADOW_DISTANCE = 1f/48;