From 35d294387cca5ed467a830cf408c3c8866e847bc Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Mon, 14 Feb 2022 14:39:01 -0800 Subject: [PATCH] Init FloatingIconView properties before fetching drawable. & Make sure properties are reset when recycled. This fixes the bug that causes BubbleTextView drawable not to get set. Bug: 207389002 Test: locally disable loading AdaptiveIcons, ensure BubbleTextView drawable always gets drawn for closing animation Change-Id: Ifdbf3e733e27918c57a5e9b23e5a11b65f8f338c (cherry picked from commit b2670d205131eb7d22c700e0149085031d21db39) Merged-In: Ifdbf3e733e27918c57a5e9b23e5a11b65f8f338c --- .../android/launcher3/views/FloatingIconView.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/com/android/launcher3/views/FloatingIconView.java b/src/com/android/launcher3/views/FloatingIconView.java index dc3ee43548..0a800c3c6e 100644 --- a/src/com/android/launcher3/views/FloatingIconView.java +++ b/src/com/android/launcher3/views/FloatingIconView.java @@ -564,6 +564,12 @@ public class FloatingIconView extends FrameLayout implements launcher, parent); view.recycle(); + // Init properties before getting the drawable. + view.mIsVerticalBarLayout = launcher.getDeviceProfile().isVerticalBarLayout(); + view.mIsOpening = isOpening; + view.mOriginalIcon = originalView; + view.mPositionOut = positionOut; + // Get the drawable on the background thread boolean shouldLoadIcon = originalView.getTag() instanceof ItemInfo && hideOriginal; if (shouldLoadIcon) { @@ -577,11 +583,6 @@ public class FloatingIconView extends FrameLayout implements } sIconLoadResult = null; - view.mIsVerticalBarLayout = launcher.getDeviceProfile().isVerticalBarLayout(); - view.mIsOpening = isOpening; - view.mOriginalIcon = originalView; - view.mPositionOut = positionOut; - // Match the position of the original view. view.matchPositionOf(launcher, originalView, isOpening, positionOut); @@ -639,6 +640,7 @@ public class FloatingIconView extends FrameLayout implements mLoadIconSignal = null; mEndRunnable = null; mFinalDrawableBounds.setEmpty(); + mIsOpening = false; mPositionOut = null; mListenerView.setListener(null); mOriginalIcon = null;