From d82c5cd2b05b2260c6c600fe31cd4680e2307121 Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Tue, 27 Feb 2018 10:10:29 -0800 Subject: [PATCH] Set disabled state when getting new icon from DrawableFactory. Change-Id: Ic9c508d24cc0e65d45f5c1f4bcbe8d5cd7fb9200 --- .../android/launcher3/LauncherAppTransitionManagerImpl.java | 6 ++---- src/com/android/launcher3/BubbleTextView.java | 1 - src/com/android/launcher3/graphics/DrawableFactory.java | 4 +++- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java b/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java index 0fe29e35dc..3ba06620b1 100644 --- a/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java +++ b/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java @@ -501,10 +501,8 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag mFloatingView = new View(mLauncher); if (isBubbleTextView && v.getTag() instanceof ItemInfoWithIcon ) { // Create a copy of the app icon - ItemInfoWithIcon info = (ItemInfoWithIcon) v.getTag(); - FastBitmapDrawable d = DrawableFactory.get(mLauncher).newIcon(info); - d.setIsDisabled(info.isDisabled()); - mFloatingView.setBackground(d); + mFloatingView.setBackground( + DrawableFactory.get(mLauncher).newIcon((ItemInfoWithIcon) v.getTag())); } // Position the floating view exactly on top of the original diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index dbdb2dca95..4f50d1a427 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -231,7 +231,6 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver, FastBitmapDrawable iconDrawable = DrawableFactory.get(getContext()).newIcon(info); mBadgeColor = IconPalette.getMutedColor(info.iconColor, 0.54f); - iconDrawable.setIsDisabled(info.isDisabled()); setIcon(iconDrawable); setText(info.title); if (info.contentDescription != null) { diff --git a/src/com/android/launcher3/graphics/DrawableFactory.java b/src/com/android/launcher3/graphics/DrawableFactory.java index 32d9e41455..3393469223 100644 --- a/src/com/android/launcher3/graphics/DrawableFactory.java +++ b/src/com/android/launcher3/graphics/DrawableFactory.java @@ -65,7 +65,9 @@ public class DrawableFactory { * Returns a FastBitmapDrawable with the icon. */ public FastBitmapDrawable newIcon(ItemInfoWithIcon info) { - return new FastBitmapDrawable(info); + FastBitmapDrawable drawable = new FastBitmapDrawable(info); + drawable.setIsDisabled(info.isDisabled()); + return drawable; } /**