From 799c54a89a841c969f9cf4dd7c35dad7a34df38c Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Wed, 17 Apr 2019 13:52:08 -0700 Subject: [PATCH] Do not draw anying in FloatingIconView if we are not hiding the original icon Bug: 129328259 Change-Id: Id4312d692b2a337aefe082e40faec344e76ecabb --- src/com/android/launcher3/views/FloatingIconView.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/com/android/launcher3/views/FloatingIconView.java b/src/com/android/launcher3/views/FloatingIconView.java index 524c69f181..2c21f73c52 100644 --- a/src/com/android/launcher3/views/FloatingIconView.java +++ b/src/com/android/launcher3/views/FloatingIconView.java @@ -377,6 +377,7 @@ public class FloatingIconView extends View implements Animator.AnimatorListener, * Creates a floating icon view for {@param originalView}. * @param originalView The view to copy * @param hideOriginal If true, it will hide {@param originalView} while this view is visible. + * Else, we will not draw anything in this view. * @param positionOut Rect that will hold the size and position of v. * @param isOpening True if this view replaces the icon for app open animation. */ @@ -392,14 +393,11 @@ public class FloatingIconView extends View implements Animator.AnimatorListener, // Get the drawable on the background thread // Must be called after matchPositionOf so that we know what size to load. - if (originalView.getTag() instanceof ItemInfo) { + if (originalView.getTag() instanceof ItemInfo && hideOriginal) { view.mLoadIconSignal = new CancellationSignal(); Runnable onIconLoaded = () -> { // Delay swapping views until the icon is loaded to prevent a flash. view.setVisibility(VISIBLE); - if (hideOriginal) { - originalView.setVisibility(INVISIBLE); - } }; CancellationSignal loadIconSignal = view.mLoadIconSignal; new Handler(LauncherModel.getWorkerLooper()).postAtFrontOfQueue(() -> {