From a0fb57dc43128e9087a146a33f3300404e41060d Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Mon, 7 Mar 2022 14:41:32 -0800 Subject: [PATCH] Let BubbleTextHolder extend IconLabelDotView This properly hides just the icon/dot and leaves the text for All Apps views during the app launch/exit animation. Bug: 213306709 Test: open/close apps on workspace, open/swipe back apps in all apps Change-Id: I327ce3e41298e50e34b8809491fc6d97a89f9f96 --- .../android/launcher3/views/BubbleTextHolder.java | 12 +++++++++++- .../android/launcher3/views/FloatingIconView.java | 14 +++----------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/com/android/launcher3/views/BubbleTextHolder.java b/src/com/android/launcher3/views/BubbleTextHolder.java index 1cb27e1649..76c465cbc8 100644 --- a/src/com/android/launcher3/views/BubbleTextHolder.java +++ b/src/com/android/launcher3/views/BubbleTextHolder.java @@ -22,7 +22,7 @@ import com.android.launcher3.model.data.ItemInfoWithIcon; /** * Views that contain {@link BubbleTextView} should implement this interface. */ -public interface BubbleTextHolder { +public interface BubbleTextHolder extends IconLabelDotView { BubbleTextView getBubbleText(); /** @@ -32,4 +32,14 @@ public interface BubbleTextHolder { */ default void onItemInfoUpdated(ItemInfoWithIcon itemInfo) { } + + @Override + default void setIconVisible(boolean visible) { + getBubbleText().setIconVisible(visible); + } + + @Override + default void setForceHideDot(boolean hide) { + getBubbleText().setForceHideDot(hide); + } } diff --git a/src/com/android/launcher3/views/FloatingIconView.java b/src/com/android/launcher3/views/FloatingIconView.java index 0f69530ec0..1c4ca8c6a4 100644 --- a/src/com/android/launcher3/views/FloatingIconView.java +++ b/src/com/android/launcher3/views/FloatingIconView.java @@ -587,7 +587,7 @@ public class FloatingIconView extends FrameLayout implements view.matchPositionOf(launcher, originalView, isOpening, positionOut); // We need to add it to the overlay, but keep it invisible until animation starts.. - view.setVisibility(INVISIBLE); + setIconAndDotVisible(view, false); parent.addView(view); dragLayer.addView(view.mListenerView); view.mListenerView.setListener(view::fastFinish); @@ -596,16 +596,8 @@ public class FloatingIconView extends FrameLayout implements view.mEndRunnable = null; if (hideOriginal) { - if (isOpening) { - setIconAndDotVisible(originalView, true); - view.finish(dragLayer); - } else { - originalView.setVisibility(VISIBLE); - if (originalView instanceof IconLabelDotView) { - setIconAndDotVisible(originalView, true); - } - view.finish(dragLayer); - } + setIconAndDotVisible(originalView, true); + view.finish(dragLayer); } else { view.finish(dragLayer); }