Fixing badge bounds incorrectly set when dragging icon
Bug: 64427027 Change-Id: If57bdcab703b2cc30e8ca0c0fba0dd599792bd00
This commit is contained in:
parent
f2b83d0e84
commit
5be7579598
|
@ -218,6 +218,12 @@ public class DragView extends View {
|
||||||
|
|
||||||
Rect bounds = new Rect(0, 0, w, h);
|
Rect bounds = new Rect(0, 0, w, h);
|
||||||
bounds.inset(blurMargin, blurMargin);
|
bounds.inset(blurMargin, blurMargin);
|
||||||
|
// Badge is applied after icon normalization so the bounds for badge should not
|
||||||
|
// be scaled down due to icon normalization.
|
||||||
|
Rect badgeBounds = new Rect(bounds);
|
||||||
|
mBadge = getBadge(info, appState, outObj[0]);
|
||||||
|
mBadge.setBounds(badgeBounds);
|
||||||
|
|
||||||
Utilities.scaleRectAboutCenter(bounds,
|
Utilities.scaleRectAboutCenter(bounds,
|
||||||
IconNormalizer.getInstance(mLauncher).getScale(dr, null, null, null));
|
IconNormalizer.getInstance(mLauncher).getScale(dr, null, null, null));
|
||||||
AdaptiveIconDrawable adaptiveIcon = (AdaptiveIconDrawable) dr;
|
AdaptiveIconDrawable adaptiveIcon = (AdaptiveIconDrawable) dr;
|
||||||
|
@ -234,9 +240,6 @@ public class DragView extends View {
|
||||||
mTranslateY = new SpringFloatValue(DragView.this,
|
mTranslateY = new SpringFloatValue(DragView.this,
|
||||||
h * AdaptiveIconDrawable.getExtraInsetFraction());
|
h * AdaptiveIconDrawable.getExtraInsetFraction());
|
||||||
|
|
||||||
mBadge = getBadge(info, appState, outObj[0]);
|
|
||||||
mBadge.setBounds(bounds);
|
|
||||||
|
|
||||||
bounds.inset(
|
bounds.inset(
|
||||||
(int) (-bounds.width() * AdaptiveIconDrawable.getExtraInsetFraction()),
|
(int) (-bounds.width() * AdaptiveIconDrawable.getExtraInsetFraction()),
|
||||||
(int) (-bounds.height() * AdaptiveIconDrawable.getExtraInsetFraction())
|
(int) (-bounds.height() * AdaptiveIconDrawable.getExtraInsetFraction())
|
||||||
|
|
Loading…
Reference in New Issue