From 2cbb6dc5e46e00d87214b192c40bce8889ba4068 Mon Sep 17 00:00:00 2001 From: Liran Binyamin Date: Thu, 16 May 2024 10:10:13 -0400 Subject: [PATCH] Suppress bubble animation when IME is visible When the IME is visible we now don't animate the bubble bar. Flag: ACONFIG com.android.wm.shell.enable_bubble_bar DEVELOPMENT Bug: 340532785 Test: manual Change-Id: I31fcf6a1fe81d907a9a02780ba42813111ac7e90 --- .../taskbar/bubbles/BubbleBarController.java | 16 +++++++++++++--- .../taskbar/bubbles/BubbleControllers.java | 3 ++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java index 5789f0c611..e5befba9dc 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java @@ -67,7 +67,6 @@ import com.android.launcher3.R; import com.android.launcher3.icons.BitmapInfo; import com.android.launcher3.icons.BubbleIconFactory; import com.android.launcher3.shortcuts.ShortcutRequest; -import com.android.launcher3.taskbar.TaskbarControllers; import com.android.launcher3.util.DisplayController; import com.android.launcher3.util.Executors.SimpleThreadFactory; import com.android.quickstep.SystemUiProxy; @@ -147,6 +146,7 @@ public class BubbleBarController extends IBubblesListener.Stub { private BubbleBarItem mSelectedBubble; private BubbleBarOverflow mOverflowBubble; + private ImeVisibilityChecker mImeVisibilityChecker; private BubbleBarViewController mBubbleBarViewController; private BubbleStashController mBubbleStashController; private BubbleStashedHandleViewController mBubbleStashedHandleViewController; @@ -215,7 +215,10 @@ public class BubbleBarController extends IBubblesListener.Stub { mSystemUiProxy.setBubblesListener(null); } - public void init(TaskbarControllers controllers, BubbleControllers bubbleControllers) { + /** Initializes controllers. */ + public void init(BubbleControllers bubbleControllers, + ImeVisibilityChecker imeVisibilityChecker) { + mImeVisibilityChecker = imeVisibilityChecker; mBubbleBarViewController = bubbleControllers.bubbleBarViewController; mBubbleStashController = bubbleControllers.bubbleStashController; mBubbleStashedHandleViewController = bubbleControllers.bubbleStashedHandleViewController; @@ -320,7 +323,8 @@ public class BubbleBarController extends IBubblesListener.Stub { // enabling gesture nav. also suppress animation if the bubble bar is hidden for sysui e.g. // the shade is open, or we're locked. final boolean suppressAnimation = - update.initialState || mBubbleBarViewController.isHiddenForSysui(); + update.initialState || mBubbleBarViewController.isHiddenForSysui() + || mImeVisibilityChecker.isImeVisible(); BubbleBarItem previouslySelectedBubble = mSelectedBubble; BubbleBarBubble bubbleToSelect = null; @@ -666,4 +670,10 @@ public class BubbleBarController extends IBubblesListener.Stub { displayBounds.bottom = displaySize.y - translation; return displayBounds; } + + /** Interface for checking whether the IME is visible. */ + public interface ImeVisibilityChecker { + /** Whether the IME is visible. */ + boolean isImeVisible(); + } } diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleControllers.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleControllers.java index 295477c963..32d6375462 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleControllers.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleControllers.java @@ -64,7 +64,8 @@ public class BubbleControllers { * in constructors for now, as some controllers may still be waiting for init(). */ public void init(TaskbarControllers taskbarControllers) { - bubbleBarController.init(taskbarControllers, this); + bubbleBarController.init(this, + taskbarControllers.navbarButtonsViewController::isImeVisible); bubbleBarViewController.init(taskbarControllers, this); bubbleStashedHandleViewController.init(taskbarControllers, this); bubbleStashController.init(taskbarControllers, this);