From 5bf8bffdb296058c8389e24d070635b5dcee1119 Mon Sep 17 00:00:00 2001 From: mpodolian Date: Wed, 6 Nov 2024 16:11:35 -0800 Subject: [PATCH] Fixed quick search bar shrinking. Added an early return logic. So only icon translation provider is being set to the hotseat icons. Fixes: 375240372 Fixes: 377402904 Flag: com.android.wm.shell.enable_bubble_bar Test: Manual. Added first bubble on unfolded Felix, quick search bar remained the same size. Fold the device, hotseat icons do not overlap. Change-Id: I292e565a79cfe121c2f8c617440d8b40c09bef82 --- src/com/android/launcher3/Hotseat.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java index 27602afa36..6468f749ac 100644 --- a/src/com/android/launcher3/Hotseat.java +++ b/src/com/android/launcher3/Hotseat.java @@ -186,18 +186,20 @@ public class Hotseat extends CellLayout implements Insettable { */ public void adjustForBubbleBar(boolean isBubbleBarVisible) { DeviceProfile dp = mActivity.getDeviceProfile(); + float adjustedBorderSpace = dp.getHotseatAdjustedBorderSpaceForBubbleBar(getContext()); + boolean adjustmentRequired = Float.compare(adjustedBorderSpace, 0f) != 0; ShortcutAndWidgetContainer icons = getShortcutsAndWidgets(); - AnimatorSet animatorSet = new AnimatorSet(); - // update the translation provider for future layout passes of hotseat icons. - if (isBubbleBarVisible) { + if (adjustmentRequired && isBubbleBarVisible) { icons.setTranslationProvider( cellX -> dp.getHotseatAdjustedTranslation(getContext(), cellX)); } else { icons.setTranslationProvider(null); } + if (!adjustmentRequired) return; + AnimatorSet animatorSet = new AnimatorSet(); for (int i = 0; i < icons.getChildCount(); i++) { View child = icons.getChildAt(i); float tx = isBubbleBarVisible ? dp.getHotseatAdjustedTranslation(getContext(), i) : 0;