Merge "Integrated new BubbleStashControllers into the existing code." into main
This commit is contained in:
commit
fcde085beb
20 files changed
+169
-549
No files matched your search
@@ -111,8 +111,12 @@ import com.android.launcher3.taskbar.bubbles.BubbleControllers;
|
||||
import com.android.launcher3.taskbar.bubbles.BubbleDismissController;
|
||||
import com.android.launcher3.taskbar.bubbles.BubbleDragController;
|
||||
import com.android.launcher3.taskbar.bubbles.BubblePinController;
|
||||
import com.android.launcher3.taskbar.bubbles.BubbleStashController;
|
||||
import com.android.launcher3.taskbar.bubbles.BubbleStashedHandleViewController;
|
||||
import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController;
|
||||
import com.android.launcher3.taskbar.bubbles.stashing.BubbleStashController.TaskbarHotseatDimensionsProvider;
|
||||
import com.android.launcher3.taskbar.bubbles.stashing.DeviceProfileDimensionsProviderAdapter;
|
||||
import com.android.launcher3.taskbar.bubbles.stashing.PersistentBubbleStashController;
|
||||
import com.android.launcher3.taskbar.bubbles.stashing.TransientBubbleStashController;
|
||||
import com.android.launcher3.taskbar.customization.TaskbarFeatureEvaluator;
|
||||
import com.android.launcher3.taskbar.customization.TaskbarSpecsEvaluator;
|
||||
import com.android.launcher3.taskbar.navbutton.NearestTouchFrame;
|
||||
@@ -150,6 +154,7 @@ import com.android.systemui.shared.system.ActivityManagerWrapper;
|
||||
import com.android.systemui.shared.system.QuickStepContract.SystemUiStateFlags;
|
||||
import com.android.systemui.unfold.updates.RotationChangeProvider;
|
||||
import com.android.systemui.unfold.util.ScopedUnfoldTransitionProgressProvider;
|
||||
import com.android.wm.shell.Flags;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.util.Collections;
|
||||
@@ -250,15 +255,18 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
|
||||
mWindowManager = c.getSystemService(WindowManager.class);
|
||||
|
||||
// Inflate views.
|
||||
int taskbarLayout = DisplayController.isTransientTaskbar(this) && !isPhoneMode()
|
||||
? R.layout.transient_taskbar
|
||||
: R.layout.taskbar;
|
||||
final boolean isTransientTaskbar = DisplayController.isTransientTaskbar(this)
|
||||
&& !isPhoneMode();
|
||||
int taskbarLayout = isTransientTaskbar ? R.layout.transient_taskbar : R.layout.taskbar;
|
||||
mDragLayer = (TaskbarDragLayer) mLayoutInflater.inflate(taskbarLayout, null, false);
|
||||
TaskbarView taskbarView = mDragLayer.findViewById(R.id.taskbar_view);
|
||||
TaskbarScrimView taskbarScrimView = mDragLayer.findViewById(R.id.taskbar_scrim);
|
||||
NearestTouchFrame navButtonsView = mDragLayer.findViewById(R.id.navbuttons_view);
|
||||
StashedHandleView stashedHandleView = mDragLayer.findViewById(R.id.stashed_handle);
|
||||
BubbleBarView bubbleBarView = mDragLayer.findViewById(R.id.taskbar_bubbles);
|
||||
BubbleBarView bubbleBarView = null;
|
||||
if (isTransientTaskbar || Flags.enableBubbleBarInPersistentTaskBar()) {
|
||||
bubbleBarView = mDragLayer.findViewById(R.id.taskbar_bubbles);
|
||||
}
|
||||
StashedHandleView bubbleHandleView = mDragLayer.findViewById(R.id.stashed_bubble_handle);
|
||||
|
||||
mAccessibilityDelegate = new TaskbarShortcutMenuAccessibilityDelegate(this);
|
||||
@@ -267,11 +275,21 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
|
||||
Optional<BubbleControllers> bubbleControllersOptional = Optional.empty();
|
||||
BubbleBarController.onTaskbarRecreated();
|
||||
if (BubbleBarController.isBubbleBarEnabled() && bubbleBarView != null) {
|
||||
Optional<BubbleStashedHandleViewController> bubbleHandleController = Optional.empty();
|
||||
if (isTransientTaskbar) {
|
||||
bubbleHandleController = Optional.of(
|
||||
new BubbleStashedHandleViewController(this, bubbleHandleView));
|
||||
}
|
||||
TaskbarHotseatDimensionsProvider dimensionsProvider =
|
||||
new DeviceProfileDimensionsProviderAdapter(this);
|
||||
BubbleStashController bubbleStashController = isTransientTaskbar
|
||||
? new TransientBubbleStashController(dimensionsProvider, getResources())
|
||||
: new PersistentBubbleStashController(dimensionsProvider);
|
||||
bubbleControllersOptional = Optional.of(new BubbleControllers(
|
||||
new BubbleBarController(this, bubbleBarView),
|
||||
new BubbleBarViewController(this, bubbleBarView),
|
||||
new BubbleStashController(this),
|
||||
new BubbleStashedHandleViewController(this, bubbleHandleView),
|
||||
bubbleStashController,
|
||||
bubbleHandleController,
|
||||
new BubbleDragController(this),
|
||||
new BubbleDismissController(this, mDragLayer),
|
||||
new BubbleBarPinController(this, mDragLayer,
|
||||
@@ -925,8 +943,9 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
|
||||
mControllers.uiController.updateStateForSysuiFlags(systemUiStateFlags);
|
||||
mControllers.bubbleControllers.ifPresent(controllers -> {
|
||||
controllers.bubbleBarController.updateStateForSysuiFlags(systemUiStateFlags);
|
||||
controllers.bubbleStashedHandleViewController.setIsHomeButtonDisabled(
|
||||
mControllers.navbarButtonsViewController.isHomeDisabled());
|
||||
controllers.bubbleStashedHandleViewController.ifPresent(controller ->
|
||||
controller.setIsHomeButtonDisabled(
|
||||
mControllers.navbarButtonsViewController.isHomeDisabled()));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -964,6 +983,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
|
||||
public void onTransitionModeUpdated(int barMode, boolean checkBarModes) {
|
||||
mControllers.navbarButtonsViewController.onTransitionModeUpdated(barMode, checkBarModes);
|
||||
}
|
||||
|
||||
public void onNavButtonsDarkIntensityChanged(float darkIntensity) {
|
||||
mControllers.navbarButtonsViewController.getTaskbarNavButtonDarkIntensity()
|
||||
.updateValue(darkIntensity);
|
||||
|
||||
Reference in new issue
Block a user