Modify Taskbar code to accommodate bubble bar gesture to stash/unstash

* Bubble bar typically follows the behavior of taskbar - if taskbar
  is shown, the bubble bar is shown, if taskbar hides, bubble bar
  hides.
* The bubble bar has 3 states: stashed, collapsed (unstashed but
  the bubbles are not expanded), and expanded. When bubbles are
  expanded, this means WMShell is rendering the bubble
  expanded view. In this situation taskbar becomes collapsed.

Bug: 253318833
Test: manual - flag turned on - see go/bubble-bar-tests
Test: manual - flag turned off:
             - launch an app, ensure taskbar is stashed
             - unstash taskbar, drag down on taskbar, ensure it
               becomes stashed
             - be in an app, unstash taskbar, interact with the app,
               ensure taskbar is stashed
             - be in an app, unstash taskbar, select an app from it,
               ensure taskbar is stashed & app is opened
Flag: WM_BUBBLE_BAR
Change-Id: I7b481d768182c8429160ab4a9b213b885a7d78bc
This commit is contained in:
Mady Mellor
2023-04-07 14:14:09 -07:00
parent 7bae2b82ef
commit 6dea6d1624
10 changed files with 183 additions and 36 deletions

View File

@@ -449,6 +449,11 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
return mControllers.taskbarDragController;
}
@Nullable
public BubbleControllers getBubbleControllers() {
return mControllers.bubbleControllers.orElse(null);
}
@Override
public ViewCache getViewCache() {
return mViewCache;
@@ -641,8 +646,12 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
mControllers.taskbarForceVisibleImmersiveController.updateSysuiFlags(systemUiStateFlags);
mControllers.voiceInteractionWindowController.setIsVoiceInteractionWindowVisible(
(systemUiStateFlags & SYSUI_STATE_VOICE_INTERACTION_WINDOW_SHOWING) != 0, fromInit);
mControllers.uiController.updateStateForSysuiFlags(systemUiStateFlags);
mControllers.bubbleControllers.ifPresent(controllers -> {
controllers.bubbleBarController.updateStateForSysuiFlags(systemUiStateFlags);
controllers.bubbleStashedHandleViewController.setIsHomeButtonDisabled(
mControllers.navbarButtonsViewController.isHomeDisabled());
});
}
/**
@@ -738,7 +747,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
}
}
mWindowLayoutParams.height = height;
mControllers.taskbarInsetsController.onTaskbarWindowHeightOrInsetsChanged();
mControllers.taskbarInsetsController.onTaskbarOrBubblebarWindowHeightOrInsetsChanged();
mWindowManager.updateViewLayout(mDragLayer, mWindowLayoutParams);
}
@@ -996,10 +1005,19 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
* Called when we want to unstash taskbar when user performs swipes up gesture.
*/
public void onSwipeToUnstashTaskbar() {
mControllers.taskbarStashController.updateAndAnimateTransientTaskbar(false);
mControllers.taskbarStashController.updateAndAnimateTransientTaskbar(/* stash= */ false);
mControllers.taskbarEduTooltipController.hide();
}
/**
* Called when we want to open bubblebar when user performs swipes up gesture.
*/
public void onSwipeToOpenBubblebar() {
mControllers.bubbleControllers.ifPresent(controllers -> {
controllers.bubbleStashController.showBubbleBar(/* expandBubbles= */ true);
});
}
/** Returns {@code true} if Taskbar All Apps is open. */
public boolean isTaskbarAllAppsOpen() {
return mControllers.taskbarAllAppsController.isOpen();