Update placement of the hotseat according to the bubble bar location.

Update the hotseat and Qsb placement according to the 3 nav buttons bar.

Test: Manual.
Set navigation mode to 3 buttons.
On launcher home screen move the bubble bar from one side to another.
Observe that the Hotseat and Qsb moving together with the navigation
bar.
Once moved the bubble bar, expand the bubble bar and collapse it.
Observe how the Hotseat is stashing and un-stashing.
After bubble bar changes position hit the recent apps button, observe
the transition.
On launcher home screen start application with the hotseat icon and exit
opened application. Observe that flying icon comes back to the correct
position in the hotseat.
Video with the above scenarios:
http://recall/-/gx8ASgewUeUS3QYohfrd1J/blTYrKopTyufOcRoPuVpYK
Bug: 346381754
Flag: com.android.wm.shell.enable_bubble_bar_in_persistent_task_bar

Change-Id: Ic8c6acdffbbb111cbe4f3fd6bc60195578d7035d
This commit is contained in:
mpodolian
2024-09-13 17:43:11 -07:00
parent bce3fb1153
commit dfb48214ea
14 changed files with 284 additions and 28 deletions
@@ -37,6 +37,7 @@ import static com.android.launcher3.LauncherState.NO_OFFSET;
import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.launcher3.LauncherState.OVERVIEW_MODAL_TASK;
import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT;
import static com.android.launcher3.Utilities.isRtl;
import static com.android.launcher3.compat.AccessibilityManagerCompat.sendCustomAccessibilityEvent;
import static com.android.launcher3.config.FeatureFlags.enableSplitContextually;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_TAP;
@@ -65,6 +66,8 @@ import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent
import static com.android.quickstep.util.AnimUtils.completeRunnableListCallback;
import static com.android.quickstep.util.SplitAnimationTimings.TABLET_HOME_TO_SPLIT;
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_HOME_KEY;
import static com.android.wm.shell.Flags.enableBubbleAnything;
import static com.android.wm.shell.Flags.enableBubbleBarInPersistentTaskBar;
import static com.android.wm.shell.shared.split.SplitScreenConstants.SNAP_TO_50_50;
import android.animation.Animator;
@@ -198,6 +201,7 @@ import com.android.systemui.unfold.config.UnfoldTransitionConfig;
import com.android.systemui.unfold.dagger.UnfoldMain;
import com.android.systemui.unfold.progress.RemoteUnfoldTransitionReceiver;
import com.android.systemui.unfold.updates.RotationChangeProvider;
import com.android.wm.shell.shared.bubbles.BubbleBarLocation;
import com.android.wm.shell.shared.desktopmode.DesktopModeStatus;
import kotlin.Unit;
@@ -239,6 +243,7 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer,
private SplitSelectStateController mSplitSelectStateController;
private SplitWithKeyboardShortcutController mSplitWithKeyboardShortcutController;
private SplitToWorkspaceController mSplitToWorkspaceController;
private BubbleBarLocation mBubbleBarLocation;
/**
* If Launcher restarted while in the middle of an Overview split select, it needs this data to
@@ -463,7 +468,7 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer,
if (Flags.enablePrivateSpace()) {
shortcuts.add(UNINSTALL_APP);
}
if (com.android.wm.shell.Flags.enableBubbleAnything()) {
if (enableBubbleAnything()) {
shortcuts.add(BUBBLE_SHORTCUT);
}
return shortcuts.stream();
@@ -1105,6 +1110,29 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer,
return mTaskbarUIController;
}
/** Provides the translation X for the hotseat item. */
public int getHotseatItemTranslationX(ItemInfo itemInfo) {
int translationX = 0;
if (isBubbleBarEnabled()
&& enableBubbleBarInPersistentTaskBar()
&& mBubbleBarLocation != null) {
boolean isBubblesOnLeft = mBubbleBarLocation.isOnLeft(isRtl(getResources()));
translationX += mDeviceProfile
.getHotseatTranslationXForBubbleBar(/* isNavbarOnRight = */ isBubblesOnLeft);
}
if (isBubbleBarEnabled() && hasBubbles()) {
// TODO(368379159) : create a class to reuse computation logic
float adjustedBorderSpace =
mDeviceProfile.getHotseatAdjustedBorderSpaceForBubbleBar(this);
if (Float.compare(adjustedBorderSpace, 0f) != 0) {
float borderSpaceDelta = adjustedBorderSpace - mDeviceProfile.hotseatBorderSpace;
translationX +=
(int) (mDeviceProfile.iconSizePx + itemInfo.cellX * borderSpaceDelta);
}
}
return translationX;
}
public SplitToWorkspaceController getSplitToWorkspaceController() {
return mSplitToWorkspaceController;
}
@@ -1410,6 +1438,11 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer,
SystemUiProxy.INSTANCE.get(this).showAppBubble(intent);
}
/** Sets the location of the bubble bar */
public void setBubbleBarLocation(BubbleBarLocation bubbleBarLocation) {
mBubbleBarLocation = bubbleBarLocation;
}
private static final class LauncherTaskViewController extends
TaskViewTouchController<QuickstepLauncher> {