Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

packages-apps-Launcher3: Commit

packages/apps/Launcher3


Commit MetaInfo

Revisión9279496e542e6dee3355e19e4a696e800873ee96 (tree)
Tiempo2017-06-07 05:21:11
AutorHyunyoung Song <hyunyoungs@goog...>
CommiterHyunyoung Song

Log Message

Prevent clipping on the top and left side on AdaptiveIconDrawables
b/62372639

Change-Id: I0b2c0daecba2904f3e89f7b0b558d9b10f5dcbf6

Cambiar Resumen

Diferencia

--- a/src/com/android/launcher3/graphics/LauncherIcons.java
+++ b/src/com/android/launcher3/graphics/LauncherIcons.java
@@ -266,9 +266,10 @@ public class LauncherIcons {
266266
267267 sOldBounds.set(icon.getBounds());
268268 if (Utilities.isAtLeastO() && icon instanceof AdaptiveIconDrawable) {
269- int offset = Math.min(left, top);
269+ int offset = Math.max((int)(ShadowGenerator.BLUR_FACTOR * iconBitmapSize),
270+ Math.min(left, top));
270271 int size = Math.max(width, height);
271- icon.setBounds(offset, offset, offset + size, offset + size);
272+ icon.setBounds(offset, offset, size, size);
272273 } else {
273274 icon.setBounds(left, top, left+width, top+height);
274275 }
--- a/src/com/android/launcher3/graphics/ShadowGenerator.java
+++ b/src/com/android/launcher3/graphics/ShadowGenerator.java
@@ -35,7 +35,7 @@ public class ShadowGenerator {
3535
3636 // Percent of actual icon size
3737 private static final float HALF_DISTANCE = 0.5f;
38- private static final float BLUR_FACTOR = 0.5f/48;
38+ public static final float BLUR_FACTOR = 0.5f/48;
3939
4040 // Percent of actual icon size
4141 private static final float KEY_SHADOW_DISTANCE = 1f/48;
Show on old repository browser