summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHyunyoung Song <hyunyoungs@google.com>2017-06-06 12:12:22 -0700
committerHyunyoung Song <hyunyoungs@google.com>2017-06-06 13:21:11 -0700
commit9279496e542e6dee3355e19e4a696e800873ee96 (patch)
tree4e62690d9b7c0d16339421b8d9ef774f4a2af424
parent0270039b98ec2cb4e641c88dabea0ca157d55596 (diff)
downloadandroid_packages_apps_Trebuchet-9279496e542e6dee3355e19e4a696e800873ee96.tar.gz
android_packages_apps_Trebuchet-9279496e542e6dee3355e19e4a696e800873ee96.tar.bz2
android_packages_apps_Trebuchet-9279496e542e6dee3355e19e4a696e800873ee96.zip
Prevent clipping on the top and left side on AdaptiveIconDrawables
b/62372639 Change-Id: I0b2c0daecba2904f3e89f7b0b558d9b10f5dcbf6
-rw-r--r--src/com/android/launcher3/graphics/LauncherIcons.java5
-rw-r--r--src/com/android/launcher3/graphics/ShadowGenerator.java2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/com/android/launcher3/graphics/LauncherIcons.java b/src/com/android/launcher3/graphics/LauncherIcons.java
index 53521f22d..19e570247 100644
--- a/src/com/android/launcher3/graphics/LauncherIcons.java
+++ b/src/com/android/launcher3/graphics/LauncherIcons.java
@@ -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);
}
diff --git a/src/com/android/launcher3/graphics/ShadowGenerator.java b/src/com/android/launcher3/graphics/ShadowGenerator.java
index 469fe34e9..5d8cca8d2 100644
--- a/src/com/android/launcher3/graphics/ShadowGenerator.java
+++ b/src/com/android/launcher3/graphics/ShadowGenerator.java
@@ -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;