From bc1d0774aa3696b019ca5072d6e9de1dec934c33 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Tue, 4 Jul 2017 12:49:00 -0700 Subject: [PATCH] Fixing clip mask not getting initialized properly. Before initializing the clip mask, we were calling iconNormalization on the adaptive icon which was changing the bounds of the drawable (only for the first call). Instead setting the bounds of the drawable after icon normalization. Bug: 63010770 Change-Id: I028d1e38a0d8c4001286d343e107637cf307c4a4 --- src/com/android/launcher3/dragndrop/DragView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/launcher3/dragndrop/DragView.java b/src/com/android/launcher3/dragndrop/DragView.java index 022b3b8b11..09cfc1eac9 100644 --- a/src/com/android/launcher3/dragndrop/DragView.java +++ b/src/com/android/launcher3/dragndrop/DragView.java @@ -222,11 +222,11 @@ public class DragView extends FrameLayout { int w = mBitmap.getWidth(); int h = mBitmap.getHeight(); AdaptiveIconDrawable adaptiveIcon = (AdaptiveIconDrawable) dr; - adaptiveIcon.setBounds(0, 0, w, h); float blurSizeOutline = mLauncher.getResources() .getDimension(R.dimen.blur_size_medium_outline); float normalizationScale = IconNormalizer.getInstance(mLauncher) .getScale(adaptiveIcon, null, null, null) * ((w - blurSizeOutline) / w); + adaptiveIcon.setBounds(0, 0, w, h); final Path mask = getMaskPath(adaptiveIcon, normalizationScale); mFgImageView = setupImageView(adaptiveIcon.getForeground(), normalizationScale);